In a previous post #3642 a recipe to build Geant4 via brew has been discussed. The local formula works fine and Geant4 is properly built.
OTOH, that formula doesn’t include the Geant4 python bindings, which I tried to include by adding the flags “-DGEANT4_USE_PYTHON=ON”. Surprisingly, it does not work as expected and I get several errors similar to the one below:
... /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace using ::isunordered; ~~^ 13 errors generated.
It seems I have a broken link within the clang toolchain, maybe because I’m not using Xcode but only Command Line Tools.
Partial solution: the same issue is seen when I try to compile the examples in Geant4 without g4py, which can be easily cured with the following flag within the cmake command:
Building from source: I left brew behind and tried to build geant4 from source using the DCMAKE_OSX_SYSROOT flag, but unfortunately this flag does not solve the issue in building Geant4 with g4py (either brew or from source, but works for examples). The information present in the documentation (link) seems to not be enough to fix the issue from my side.
Is there a proper way to pass the DCMAKE_OSX_SYSROOT flag to build Geant4 with g4py?
I did a small cpp code with only
and compiled it with:
clang -v -x c++ -std=c++11 -stdlib=libc++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/ -isystem /Library/Developer/CommandLineTools/usr/include -c cmath-bug.cpp
and it works fine (but does not work without the -isystem and -isysroot flags). Possibly I have some weird config in my MacOS system that Geant4 cmake is not getting the proper c++ headers, so any help is welcome.