Mac OS X building bug

Hi all:
I upgrade my Mac to OS X 10.15 and upgrade Geant4 to 4.10.6

when I try to build example B1:
it failed

In file included from /Users/chenxu/software/Geant4/tmp/B1/exampleB1.cc:30:
In file included from /Users/chenxu/software/Geant4/tmp/B1/include/B1DetectorConstruction.hh:33:
In file included from /usr/local/include/Geant4/G4VUserDetectorConstruction.hh:38:
In file included from /usr/local/include/Geant4/globals.hh:48:
In file included from /usr/local/include/Geant4/G4ios.hh:38:
In file included from /usr/local/include/Geant4/G4Types.hh:71:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:245:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error:
      no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error:
      no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error:
      no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)

I used to meet the same problem using ROOT https://root-forum.cern.ch/t/root-catalina-bug-report/36693, it had been repaired.
How could I repair it when using Geant4?

solved!
I Found it is a bug when using apple default SDK /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
It’s Mac OS problem

Hi, I have just meet the same problem in my Mac computer.
How do you solve it?
Is it something like changing the SDK used by compiler?

cmake could set the SDK using in you program.
see https://cmake.org/cmake/help/v3.0/variable/CMAKE_OSX_SYSROOT.html

by the way. just upgrade to the lastest Mac could solve the problem

1 Like

You can do as follows:
% xcrun --show-sdk-path

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

% sudo xcode-select -s /Library/Developer/CommandLineTools

Password:

For what it’s worth, I also had this problem, but not due to any XCode settings. As it turns out, it was a GDML/Xerces-C problem. I had installed both Geant4.10.5 and 10.6, but in the latter case I had used -DGEANT4_USE_GDML=ON without manually specifying -DXERCESC_ROOT_DIR as well. As a result, it was finding a copy of the xerces libs and headers in /usr/local instead of my conda environment /anaconda3/envs/geant4py27. Changing to the latter solved it.