Problem installing ROOT 6.14.06 on mac 10.13.6 with libcxx=ON (libc++)

I configured ROOT with this command:

cmake
-Dlibcxx=ON
-Dcxx11=ON
-DCMAKE_INSTALL_PREFIX=[...]
-DPYTHON_EXECUTABLE=[...]
-DPYTHON_INCLUDE_DIR=[...]
-DPYTHON_LIBRARY=[...]

but it won’t compile successfully:

[ 45%] Generating G__Core.cxx, ../../lib/libCore.rootmap
[...]
In file included from input_line_9:12:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build/include/TApplication.h:30:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build/include/TQObject.h:41:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build/include/TList.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build/include/TSeqCollection.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build/include/TCollection.h:29:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build/include/TString.h:26:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build/include/TMathBase.h:32:
**/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9:** **error:** **no member named 'signbit' in the global namespace**
using ::signbit;
**~~^**
**/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9:** **error:** **no member named 'fpclassify' in the global namespace**
using ::fpclassify;
**~~^**
etc...

How do I fix this? I’m compiling instead of using the binary because I want to bind root to my python installation. I’m using libc++ instead of stdlibc++ because I get runtime complaints about that in correspondence of (possibly unrelated) crashes.

P.S. Should I use gcc?


ROOT Version: 6.14.06
Platform: macos 10.13.6
Compiler: Apple LLVM version 10.0.0 (clang-1000.11.45.5)


What Python are you trying to use? You have to use the same C++ compiler and same standard library that was used to compile Python if you want ROOT to be compatible (PyROOT needs to link to both Python and system libraries, and they must be compatible with each other).

Python is compiled with GCC 4.2.1 (Apple Inc. build 5666) (dot 3), but I already compiled ROOT 6.12 using system clang and PyROOT worked. But maybe that’s the reason why I can not use libc++: python must have used stdlibc++.

But the errors seem not to be related to PyROOT, which I guess is not a dependency of libCore.

Python is not C++. Please continue to use clang.

Can you run xcode-select --install, does that help?

It’s not Python that is the problem, it’s the ABI of the compiler that built Python that needs to be compatible with the one for ROOT. In your case GCC 4.2.1 is probably just a wrapper around Clang, so it should be fine. In any case, I recommend dropping libc++ from your CMake and pasting the error you get with a standard configuration. Also, please only set PYTHON_EXECUTABLE and nothing else, otherwise CMake may use incompatible python interpreter and libraries. I recommend to use the master branch since I put an error message for broken configurations.

Uhm, everything worked with root 6.12 and libcxx=OFF, the point was building with libcxx=ON. Well, I used root 6.14 this time, so something may have changed, I will launch a clean build with default configuration + custom python to know if the problem depends on libc++.

Yes, if a default build works, then we can help with libc++, we just want to make sure there isn’t another problem in your configuration. The error above does point to a problem coming from libc++ though. There may be a clash between Apple’s Clang and ROOT’s clang somewhere.

I made a clean build with configuration

cmake
-DCMAKE_INSTALL_PREFIX=[...]
-DPYTHON_EXECUTABLE=[...]

and it fails with the same errors as before, so I will try building without custom python, but from the errors I guess that is not the problem.

Another clean build, I had to specify the system-wide python explicitly with PYTHON_EXECUTABLE=... because the default configuration detected the local virtualenv automatically. Still fails at the same point:

Scanning dependencies of target G__Core
[ 73%] Generating G__Core.cxx, ../../lib/libCore.rootmap
[warnings...]
In file included from input_line_9:12:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TApplication.h:30:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TQObject.h:41:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TList.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TSeqCollection.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TCollection.h:29:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TString.h:26:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:32:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/usr/include/math.h:757:12: note: 'finite' declared here
extern int finite(double) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC...
           ^
In file included from input_line_9:12:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TApplication.h:30:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TQObject.h:41:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TList.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TSeqCollection.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TCollection.h:29:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TString.h:26:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:32:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:316:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:317:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:318:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:319:9: error: no member named 'isgreater' in the global namespace
using ::isgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:320:9: error: no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:321:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:322:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:323:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:324:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:325:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
In file included from input_line_9:12:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TApplication.h:30:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TQObject.h:41:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TList.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TSeqCollection.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TCollection.h:29:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TString.h:26:
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:125:10: warning: using integer absolute value function 'abs' when argument is of floating point
      type [-Wabsolute-value]
{ return std::abs(d); }
         ^
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:125:10: note: use function 'std::abs' instead
{ return std::abs(d); }
         ^~~~~~~~
         std::abs
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:125:10: note: include the header <cmath> or explicitly provide a declaration for 'std::abs'
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:128:10: warning: using integer absolute value function 'abs' when argument is of floating point
      type [-Wabsolute-value]
{ return std::abs(d); }
         ^
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:128:10: note: use function 'std::abs' instead
{ return std::abs(d); }
         ^~~~~~~~
         std::abs
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:128:10: note: include the header <cmath> or explicitly provide a declaration for 'std::abs'
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:131:10: warning: using integer absolute value function 'abs' when argument is of floating point
      type [-Wabsolute-value]
{ return std::abs(d); }
         ^
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:131:10: note: use function 'std::abs' instead
{ return std::abs(d); }
         ^~~~~~~~
         std::abs
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:131:10: note: include the header <cmath> or explicitly provide a declaration for 'std::abs'
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:141:18: error: expected unqualified-id
   { return std::signbit(a);  }
                 ^
/usr/include/math.h:184:5: note: expanded from macro 'signbit'
    ( sizeof(x) == sizeof(float)  ? __inline_signbitf((float)(x))        \
    ^
In file included from input_line_9:12:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TApplication.h:30:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TQObject.h:41:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TList.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TSeqCollection.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TCollection.h:29:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TString.h:26:
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:144:18: error: expected unqualified-id
   { return std::signbit(a);  }
                 ^
/usr/include/math.h:184:5: note: expanded from macro 'signbit'
    ( sizeof(x) == sizeof(float)  ? __inline_signbitf((float)(x))        \
    ^
In file included from input_line_9:12:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TApplication.h:30:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TQObject.h:41:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TList.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TSeqCollection.h:25:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TCollection.h:29:
In file included from /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TString.h:26:
/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/include/TMathBase.h:147:18: error: expected unqualified-id
   { return std::signbit(a);  }
                 ^
/usr/include/math.h:184:5: note: expanded from macro 'signbit'
    ( sizeof(x) == sizeof(float)  ? __inline_signbitf((float)(x))        \
    ^
Error: /Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/core/rootcling_stage1/src/rootcling_stage1: compilation failure (/Users/giacomo/Documents/Programmi/from-source/root/root-6.14.06-build-nopython/lib/libCoreb25593332d_dictUmbrella.h)
make[2]: *** [core/base/G__Core.cxx] Error 1
make[1]: *** [core/base/CMakeFiles/G__Core.dir/all] Error 2

I think the Xcode installation is fine because I successfully compiled gcc.

This looks like a problem with your system headers, not with ROOT. I don’t know how to help debug it, but you probably should try reinstalling XCode and running xcode-select --install again, or change the path to the command line tools or vice-versa.

Update: ROOT 6.14.06 does not compile with gcc 8.2 with the following output:

[...]
Scanning dependencies of target Macosx
[ 71%] Building CXX object core/macosx/CMakeFiles/Macosx.dir/src/CocoaUtils.mm.o
cc1objplus: error: argument to ‘-O’ should be a non-negative integer, ‘g’, ‘s’ or ‘fast’
make[2]: *** [core/macosx/CMakeFiles/Macosx.dir/src/CocoaUtils.mm.o] Error 1
make[1]: *** [core/macosx/CMakeFiles/Macosx.dir/all] Error 2

gcc 8.2 just installed compiling with support for objc++ on macos 10.13.6 with xcode 10.1. I’m not asking for an immediate solution, I just post it for reference. I guess it could compile disabling the cocoa GUI.

What flags are you using to compile ROOT?

Complete invocation was:

cmake
-DCMAKE_INSTALL_PREFIX=../root-6.14.06-install
-DCMAKE_Fortran_COMPILER=gfortran-8.2
-DCMAKE_C_COMPILER=gcc-8.2
-DCMAKE_CXX_COMPILER=g++-8.2
-DPYTHON_EXECUTABLE=$PYTHON3/python3
-Dcxx14=ON
-Droot7=ON
../root-6.14.06
cmake --build . -- -j4

Meanwhile, I’m building 6.12.06 to see if that works, because I compiled it before but probably the macos and xcode version where some patches behind the current ones.

Are you using Homebrew or anaconda? Using GCC on Mac is not a good idea in general, support is not very good. In any case, please post full error logs here, or we will not be able to help you debug your problem. Just FYI, though, you can install ROOT on Macs with brew install root. See https://formulae.brew.sh/formula/root for more information on how to customise the installation.

Compiled gcc with configure [...] && make.

I’m not able to use brew without letting it use its own packages for dependencies, for example in the ROOT package it wants to use his python, his gcc, etc. This occupies a lot of disk space, and I would have to reconfigure other things or to hack brew, for present and future convenience I would like not to. But the advice was useful, since in the brew ROOT script I found:

# Work around "error: no member named 'signbit' in the global namespace"
    ENV.delete("SDKROOT") if DevelopmentTools.clang_build_version >= 900

The error mentioned in the comment is the one I get compiling ROOT 6.14.06 with Xcode clang. There is no $SDKROOT in my environment, so uhm, maybe this means I can try

cmake  [...] -DSDKROOT=

?

Update: successfully built, used interactively, used compiling, used from python, ROOT 6.12.06 with Xcode clang (Xcode 10.1, macOS 10.13.6) with following configuration:

cmake
-DCMAKE_INSTALL_PREFIX=../root-6.12.06-install-libcxx
-DPYTHON_EXECUTABLE=$PYTHON3/python3
-Dlibcxx=ON
-Dcxx14=ON
-Droot7=ON
../root-6.12.06

So I think there is something wrong in ROOT 6.14.06.

Before debugging what’s happening, let’s get back to the fundamental questions: Why are you building with GCC on a mac? Why don’t you simply build with Xcode’s clang?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.