root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.54k stars 1.24k forks source link

root ACLiC compile with cmath error. #8418

Closed cxwx closed 3 years ago

cxwx commented 3 years ago
pcanal commented 3 years ago

To debug this please do:

root aa1.cpp++kv
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/rootcling -v0 "--lib-list-prefix=/Users/chenxu/tmp/aa1_cpp_ACLiC_map" -f "/Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/Users/chenxu/software/install2/include/healpix_cxx/" -D__ACLIC__ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include "/Users/chenxu/tmp/./aa1.cpp" "/Users/chenxu/tmp/aa1_cpp_ACLiC_linkdef.h"

and report the result of the 2nd command.

cxwx commented 3 years ago

as below, It seems no more info root aa1.cpp++kv

Processing aa1.cpp++kv...
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/chenxu/tmp/./aa1_cpp.so
Info in <TMacOSXSystem::ACLiC>: looking for header in: /Users/chenxu/tmp/.:/Users/chenxu/tmp:.::$ROOTSYS/include:"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc/":"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc//cling":"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include/":"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include":-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
Info in <ACLiC>: creating the dictionary files
Info in <ACLiC>: /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/rootcling -v0 "--lib-list-prefix=/Users/chenxu/tmp/aa1_cpp_ACLiC_map" -f "/Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc/" -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc//cling" -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include/" -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include" -D__ACLIC__ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include "/Users/chenxu/tmp/./aa1.cpp" "/Users/chenxu/tmp/aa1_cpp_ACLiC_linkdef.h"
In file included from input_line_9:6:
In file included from ././aa1.cpp:1:
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:327:9: error: no member named 'isgreater' in the global namespace
using ::isgreater;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:328:9: error: no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
Error in <ACLiC>: Executing '/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/rootcling -v0 "--lib-list-prefix=/Users/chenxu/tmp/aa1_cpp_ACLiC_map" -f "/Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc/" -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc//cling" -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include/" -I"/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include" -D__ACLIC__ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include "/Users/chenxu/tmp/./aa1.cpp" "/Users/chenxu/tmp/aa1_cpp_ACLiC_linkdef.h"' failed!
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/rootcling -v0 --lib-list-prefix=/Users/chenxu/tmp/aa1_cpp_ACLiC_map -f /Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc/ -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc//cling -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include/ -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -D__ACLIC__ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include /Users/chenxu/tmp/./aa1.cpp /Users/chenxu/tmp/aa1_cpp_ACLiC_linkdef.h
 cd /Users/chenxu/tmp ; x86_64-apple-darwin13.4.0-clang++ -fPIC -c -O2 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/root_base_1622810034106/work=/usr/local/src/conda/root_base-6.24.0 -fdebug-prefix-map=/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4=/usr/local/src/conda-prefix -std=c++17 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++  -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc/ -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc//cling -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include/ -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include  -D__ACLIC__ /Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx ; x86_64-apple-darwin13.4.0-clang++ -O2 /Users/chenxu/tmp/aa1_cpp_ACLiC_dict.o -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs -undefined dynamic_lookup   /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libc++.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libRint.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libCore.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libc++.1.0.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libpcre.1.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/liblzma.5.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libxxhash.0.8.0.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/liblz4.1.9.3.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libz.1.2.11.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libzstd.1.5.0.dylib -lfakelink -lapple_nghttp2 -lnetwork -lsqlite3 -lz.1 -lenergytrace -lMobileGestalt -lcoretls -lcoretls_cfhelpers -lxar.1 -lcompression -larchive.2 -lxml2.2 -lpcap.A -ldns_services -llzma.5 -lbz2.1.0 -liconv.2 -lcharset.1 -lCheckFix -lmecabra -lmecab -lgermantok -lThaiTokenizer -lChineseTokenizer -lcmph -lutil -lapp_launch_measurement -lxslt.1 -lspindump -late -lexpat.1 -lIOReport -lSMC -lmis -lheimdal-asn1 -lAudioStatistics -lperfcheck /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libRIO.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libThread.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libtbb.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libCling.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libImt.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libMultiProc.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libNet.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libssl.1.1.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libcrypto.1.1.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libtbbmalloc.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libMathCore.6.24.00.so -o /Users/chenxu/tmp/./aa1_cpp.so
 cd /Users/chenxu/tmp ; x86_64-apple-darwin13.4.0-clang++ -c -O2 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/root_base_1622810034106/work=/usr/local/src/conda/root_base-6.24.0 -fdebug-prefix-map=/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4=/usr/local/src/conda-prefix -std=c++17 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++  -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc/ -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/etc//cling -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include/ -I/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include  -D__ACLIC__ /Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx; x86_64-apple-darwin13.4.0-clang++ -O2 /Users/chenxu/tmp/aa1_cpp_ACLiC_dict.o  -o /Users/chenxu/tmp/aa1_cpp_ACLiC_exec  /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libc++.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libRint.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libCore.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libc++.1.0.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libpcre.1.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/liblzma.5.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libxxhash.0.8.0.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/liblz4.1.9.3.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libz.1.2.11.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libzstd.1.5.0.dylib -lfakelink -lapple_nghttp2 -lnetwork -lsqlite3 -lz.1 -lenergytrace -lMobileGestalt -lcoretls -lcoretls_cfhelpers -lxar.1 -lcompression -larchive.2 -lxml2.2 -lpcap.A -ldns_services -llzma.5 -lbz2.1.0 -liconv.2 -lcharset.1 -lCheckFix -lmecabra -lmecab -lgermantok -lThaiTokenizer -lChineseTokenizer -lcmph -lutil -lapp_launch_measurement -lxslt.1 -lspindump -late -lexpat.1 -lIOReport -lSMC -lmis -lheimdal-asn1 -lAudioStatistics -lperfcheck /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libRIO.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libThread.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libtbb.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libCling.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libImt.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libMultiProc.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libNet.6.24.00.so /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libssl.1.1.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libcrypto.1.1.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libtbbmalloc.dylib /Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/lib/libMathCore.6.24.00.so

/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/rootcling -v0 "--lib-list-prefix=/Users/chenxu/tmp/aa1_cpp_ACLiC_map" -f "/Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/Users/chenxu/software/install2/include/healpix_cxx/" -D__ACLIC__ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include "/Users/chenxu/tmp/./aa1.cpp" "/Users/chenxu/tmp/aa1_cpp_ACLiC_linkdef.h"

In file included from input_line_9:6:
In file included from ././aa1.cpp:1:
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:327:9: error: no member named 'isgreater' in the global namespace
using ::isgreater;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:328:9: error: no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/../include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
cxwx commented 3 years ago

It is metion at

https://stackoverflow.com/questions/58628377/catalina-c-using-cmath-headers-yield-error-no-member-named-signbit-in-th/59780819#59780819

the authors of <cmath> were expecting the math.h from that same folder be included first and then the #include_next <math.h> directive find the system-specific math.h. That is not what's happening in reality however.

I think it's a bug that should be fixed by apple-xcode. But what confused me is that why I could run root aa1.cpp OK but root aa1.cpp++ with errors? Does this include difference headers

pcanal commented 3 years ago

What about

/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/rootcling -v0 "--lib-list-prefix=/Users/chenxu/tmp/aa1_cpp_ACLiC_map" -f "/Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/Users/chenxu/software/install2/include/healpix_cxx/" -D__ACLIC__  "/Users/chenxu/tmp/./aa1.cpp" "/Users/chenxu/tmp/aa1_cpp_ACLiC_linkdef.h"
cxwx commented 3 years ago

/Users/chenxu/software/conda/miniconda3/envs/cxROOTGEANT4/bin/rootcling -v0 "--lib-list-prefix=/Users/chenxu/tmp/aa1_cpp_ACLiC_map" -f "/Users/chenxu/tmp/aa1_cpp_ACLiC_dict.cxx" -I$ROOTSYS/include -D__ACLIC__ "/Users/chenxu/tmp/./aa1.cpp" no errors

I found these two files

  1. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h
  2. /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h are difference. so the error message should be caused by /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h and my code should use the first one
cxwx commented 3 years ago

sorry, I made a mistake, I add ACLiC.IncludePaths: -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include Before some versions and forgot to delete this after upgrade my system. root will choose the right header if I don't set by myself. Thanks for answers