From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rocky Dunlap via lttng-dev Subject: Re: Babeltrace2 - compilation error with intel18 Date: Fri, 20 Mar 2020 15:55:16 -0600 Message-ID: References: Reply-To: Rocky Dunlap Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3994419471579982128==" Return-path: Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lists.lttng.org (Postfix) with ESMTPS id 48kcys3TBtz1Nxw for ; Fri, 20 Mar 2020 17:55:33 -0400 (EDT) Received: by mail-ot1-x333.google.com with SMTP id k26so7569757otr.2 for ; Fri, 20 Mar 2020 14:55:33 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" To: Simon Marchi Cc: lttng-dev@lists.lttng.org List-Id: lttng-dev@lists.lttng.org --===============3994419471579982128== Content-Type: multipart/alternative; boundary="00000000000029aef705a1505829" --00000000000029aef705a1505829 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Simon, I was able to get past the issue by passing "--enable-compile-warnings=3Dye= s" to configure. It get a lot further, then fails here: gcc -pthread -shared -L/apps/intel/intelpython3/lib -Wl,-rpath=3D/apps/intel/intelpython3/lib,--no-as-needed -Wl,-z,noexecstack,-z,relro,-z,now -L../../../../src/lib/.libs -pthread -lgmodule-2.0 -lglib-2.0 -pthread -lgmodule-2.0 -lglib-2.0 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fno-strict-aliasing -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -Wimplicit-function-declaration -Wold-style-definition -Wjump-misses-init -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=3D2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wswitch-enum -Wswitch-default -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion -Wno-sign-compare -Wno-inline -Wno-declaration-after-statement -Wno-switch-enum -Wno-switch-default -Wno-packed -Wno-pointer-arith -Wno-format-nonliteral -Wno-double-promotion -Wno-cast-align -Wno-cast-function-type -Wno-error=3Dunused-parameter -Wno-error=3Dmissing-field-initializers -Wno-error=3Dsign-compare -Wno-error=3Dinline -Wno-error=3Ddeclaration-after-statement -Wno-error=3Dswitch-enum -Wno-error=3Dswitch-default -Wno-error=3Dpacked -Wno-error=3Dpointer-arith -Wno-error=3Dformat-nonliteral -Wno-error=3Ddouble-promotion -Wno-error=3Dcast-align -Wno-error=3Dcast-function-type -Wold-style-definit= ion -Werror=3Dimplicit-function-declaration -g -O2 -Wno-shadow -Wno-null-dereference -I../../../../include -I../../../../src -I../../../../src -include common/config.h -I./bt2 build/temp.linux-x86_64-3.6/bt2/native_bt.o build/temp.linux-x86_64-3.6/./bt2/logging.o ../../../../src/autodisc/.libs/libbabeltrace2-autodisc.a ../../../../src/logging/.libs/libbabeltrace2-logging.a ../../../../src/common/.libs/libbabeltrace2-common.a ../../../../src/py-common/.libs/libbabeltrace2-py-common.a ../../../../src/string-format/.libs/libbabeltrace2-string-format.a -L/apps/intel/intelpython3/lib -lbabeltrace2 -lglib-2.0 -lpython3.6m -o build/build_lib/bt2/_native_bt.cpython-36m-x86_64-linux-gnu.so gcc: error: unrecognized command line option =E2=80=98-Wduplicated-cond=E2= =80=99 gcc: error: unrecognized command line option =E2=80=98-Wduplicated-branches= =E2=80=99 gcc: error: unrecognized command line option =E2=80=98-Wrestrict=E2=80=99 gcc: error: unrecognized command line option =E2=80=98-Wnull-dereference=E2= =80=99 error: command 'gcc' failed with exit status 1 make[4]: *** [build-python-bindings.stamp] Error 1 I am surprised that this is using "gcc" here, shouldn't it be using "icc" since I have CC=3Dicc? Or maybe it is supposed to be using gcc? I think if I update the GCC compiler version then it will get past this issue as well, but I just wanted confirmation that this indeed should be using a combination of gcc and icc? If it should be icc, can you point me to where in the configure/make system I can make this change to force it to use what's sets as CC instead of defaulting to GCC? Rocky On Fri, Mar 20, 2020 at 3:47 PM Simon Marchi wrote: > 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 b= it > 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 preprocesso= r > 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 =3D 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 > > --00000000000029aef705a1505829 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Simon,

I was able to get past the issue= by passing "--enable-compile-warnings=3Dyes" to configure.
=

It get a lot further, then fails here:

gcc -pthread -shared -L/apps/intel/intelpython3/lib -Wl,-rpath=3D/= apps/intel/intelpython3/lib,--no-as-needed -Wl,-z,noexecstack,-z,relro,-z,n= ow -L../../../../src/lib/.libs -pthread -lgmodule-2.0 -lglib-2.0 -pthread -= lgmodule-2.0 -lglib-2.0 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-= 2.0/include -pthread -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0= /include -fno-strict-aliasing -Wnested-externs -Wmissing-prototypes -Wstric= t-prototypes -Wdeclaration-after-statement -Wimplicit-function-declaration = -Wold-style-definition -Wjump-misses-init -Wall -Wextra -Wundef -Wwrite-str= ings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-p= arameter -Wno-missing-field-initializers -Wformat=3D2 -Wcast-align -Wformat= -nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Wi= nline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -W= missing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type= -Wswitch-enum -Wswitch-default -Wduplicated-cond -Wduplicated-branches -Wl= ogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion -Wno-sign-compar= e -Wno-inline -Wno-declaration-after-statement -Wno-switch-enum -Wno-switch= -default -Wno-packed -Wno-pointer-arith -Wno-format-nonliteral -Wno-double-= promotion -Wno-cast-align -Wno-cast-function-type -Wno-error=3Dunused-param= eter -Wno-error=3Dmissing-field-initializers -Wno-error=3Dsign-compare -Wno= -error=3Dinline -Wno-error=3Ddeclaration-after-statement -Wno-error=3Dswitc= h-enum -Wno-error=3Dswitch-default -Wno-error=3Dpacked -Wno-error=3Dpointer= -arith -Wno-error=3Dformat-nonliteral -Wno-error=3Ddouble-promotion -Wno-er= ror=3Dcast-align -Wno-error=3Dcast-function-type -Wold-style-definition -We= rror=3Dimplicit-function-declaration -g -O2 -Wno-shadow -Wno-null-dereferen= ce -I../../../../include -I../../../../src -I../../../../src -include commo= n/config.h -I./bt2 build/temp.linux-x86_64-3.6/bt2/native_bt.o build/temp.l= inux-x86_64-3.6/./bt2/logging.o ../../../../src/autodisc/.libs/libbabeltrac= e2-autodisc.a ../../../../src/logging/.libs/libbabeltrace2-logging.a ../../= ../../src/common/.libs/libbabeltrace2-common.a ../../../../src/py-common/.l= ibs/libbabeltrace2-py-common.a ../../../../src/string-format/.libs/libbabel= trace2-string-format.a -L/apps/intel/intelpython3/lib -lbabeltrace2 -lglib-= 2.0 -lpython3.6m -o build/build_lib/bt2/_native_bt.cpython-36m-x86_64-linux-gnu.sogcc: error: unrecognized command line option =E2=80=98-Wduplicated-cond=E2= =80=99
gcc: error: unrecognized command line option =E2=80=98-Wduplicate= d-branches=E2=80=99
gcc: error: unrecognized command line option =E2=80= =98-Wrestrict=E2=80=99
gcc: error: unrecognized command line option =E2= =80=98-Wnull-dereference=E2=80=99
error: command 'gcc' failed wi= th exit status 1
make[4]: *** [build-python-bindings.stamp] Error 1
<= /div>

I am surprised that this is using "gcc" = here, shouldn't it be using "icc" since I have CC=3Dicc?
<= /div>

Or maybe it is supposed to be using gcc?=C2=A0 I t= hink if I update the GCC compiler version then it will get past this issue = as well, but I just wanted confirmation that this indeed should be using a = combination of gcc and icc?

If it should be icc, c= an you point me to where in the configure/make system I can make this chang= e to force it to use what's sets as CC instead of defaulting to GCC?

Rocky

On Fri, Mar 20, 2020 at 3:47 PM Simon Mar= chi <simark@simark.ca> wrote:=
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.=C2=A0 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.=C2=A0 Although if you want to send patches to fix the bui= ld 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"
> =C2=A0 #if _MSC_VER
> =C2=A0 =C2=A0 =C2=A0 ^
>
> 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__"
> =C2=A0 #elif __clang__ || __GNUC__
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^

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 preproces= sor
condition like that, in which case it gets replaced with 0 (as the error message mentions).=C2=A0 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.=C2=A0 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*)
> =C2=A0 format_exc_func_name =3D py_exc_tb ? "format_exception&quo= t; :

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

Simon

--00000000000029aef705a1505829-- --===============3994419471579982128== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev --===============3994419471579982128==--