[lttng-dev] Babeltrace2 - compilation error with intel18

Simon Marchi simark at simark.ca
Fri Mar 20 17:47:56 EDT 2020


On 2020-03-20 5:10 p.m., Rocky Dunlap via lttng-dev wrote:
> I am trying to compile BT2 with Python bindings using Intel18.  I receive the following error during the build:
Hi Rocky,

I don't think we claim to support the Intel compiler, so you might be a bit
on your own here.  Although if you want to send patches to fix the build using
that compiler, I don't have anything against that.

> 
> In file included from py-common.c(31):
> /apps/intel/intelpython3/include/python3.6m/Python.h(149): error #193: zero used for undefined preprocessing identifier "_MSC_VER"
>   #if _MSC_VER
>       ^
> 
> In file included from py-common.c(31):
> /apps/intel/intelpython3/include/python3.6m/Python.h(151): error #193: zero used for undefined preprocessing identifier "__clang__"
>   #elif __clang__ || __GNUC__
>         ^

It took me a bit of time to understand that this is Intel's Python 3
distribution, not CPython.

I think it's technically valid to use an undefined macro in a preprocessor
condition like that, in which case it gets replaced with 0 (as the error
message mentions).  The compiler is trying to be helpful and warns you, because
relying on that behavior is a bit fragile, and often a sign of a mistake
somewhere.  But since this happens in a library you are using, I think your best
bet is just to disable this warning.

> py-common.c(187): error #3179: deprecated conversion of string literal to char* (should be const char*)
>   format_exc_func_name = py_exc_tb ? "format_exception" :

I really don't understand this one, as format_exc_func_name is a const char *
in our code.

Simon



More information about the lttng-dev mailing list