Hi I’m new to Geant4 so started with an identical setup on my MAC to that shown in:
(Youtube: “2. How to compile and install Geant4 in MacOS”)
My computer parameters are:
macOS Big Sur 11.5.1
MacOSX11.3.sdk → which I then changed to 10.9 (could try with even earlier versions)
miniconda3
(base) ME@x86_64-apple-darwin13 build % cc --version
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
(base) ME@x86_64-apple-darwin13 build % gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
(base) ME@x86_64-apple-darwin13 build % xcode-select -p
/Library/Developer/CommandLineTools
(base) ME@x86_64-apple-darwin13 build % echo $CONDA_BUILD_SYS_ROOT
/opt/MacOSX10.9.sdk
(base) ME@x86_64-apple-darwin13 build % echo $CONDA_BUILD_SYSROOT
/opt/MacOSX10.9.sdk
(base) ME@x86_64-apple-darwin13 build % softwareupdate -i -a
Software Update Tool
Finding available software
No updates are available.
The “ccmake …” command works ok (with the below parameters):
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /usr/local
CMAKE_OSX_ARCHITECTURES
CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_OSX_SYSROOT /opt/MacOSX10.9.sdk (note I can use up to 11.3)
Geant4_DIR /usr/local/lib/Geant4-10.7.2
PTL_DIR /usr/local/lib/Geant4-10.7.2/PTL
Qt53DCore_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt53DCore
Qt53DExtras_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt53DExtras
Qt53DInput_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt53DInput
Qt53DLogic_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt53DLogic
Qt53DRender_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt53DRender
Qt5Core_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt5Core
Qt5Gamepad_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt5Gamepad
Qt5Gui_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt5Gui
Qt5Network_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt5Network
Qt5OpenGL_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt5OpenGL
Qt5PrintSupport_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt5PrintSupport
Qt5Widgets_DIR /usr/local/Cellar/qt@5/5.15.2/lib/cmake/Qt5Widgets
WITH_GEANT4_UIVIS ON
The generate command then works ok
Then I try:
(base) ME@x86_64-apple-darwin13 build % make
Consolidate compiler generated dependencies of target exampleB1
[ 12%] Linking CXX executable exampleB1
ld: warning: text-based stub file /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework/OpenGL.tbd and library file /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework/OpenGL.tbd are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib/libexpat.tbd and library file /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib/libexpat.tbd are out of sync. Falling back to library file for linking.
ld: library not found for -lSystem
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [exampleB1] Error 1
make[1]: *** [CMakeFiles/exampleB1.dir/all] Error 2
make: *** [all] Error 2
I was experiencing the error: (before I changed the SDK I was using from 11.1 to 10.9 and edited cmath to include the full file path of <math.h>)
(base) ME@x86_64-apple-darwin13 build % make
Consolidate compiler generated dependencies of target exampleB1
[ 12%] Building CXX object CMakeFiles/exampleB1.dir/exampleB1.cc.o
In file included from /Users/ME/Documents/PhD/Geant4/geant4.10.07.p02/examples/basic/B1/exampleB1.cc:30:
In file included from /Users/ME/Documents/PhD/Geant4/geant4.10.07.p02/examples/basic/B1/include/B1DetectorConstruction.hh:33:
In file included from /usr/local/include/Geant4/G4VUserDetectorConstruction.hh:37:
In file included from /usr/local/include/Geant4/globals.hh:35:
In file included from /usr/local/include/Geant4/G4ios.hh:35:
In file included from /usr/local/include/Geant4/G4Types.hh:74:
In file included from /Users/ME/miniconda3/bin/…/include/c++/v1/complex:245:
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:317:9: error: no member named ‘signbit’ in the global namespace
using ::signbit;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:318:9: error: no member named ‘fpclassify’ in the global namespace
using ::fpclassify;
~~^
/Users/ME/miniconda3/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/MacOSX11.1.sdk/usr/include/math.h:752:12: note: ‘finite’ declared here
extern int finite(double)
^
In file included from /Users/ME/Documents/PhD/Geant4/geant4.10.07.p02/examples/basic/B1/exampleB1.cc:30:
In file included from /Users/ME/Documents/PhD/Geant4/geant4.10.07.p02/examples/basic/B1/include/B1DetectorConstruction.hh:33:
In file included from /usr/local/include/Geant4/G4VUserDetectorConstruction.hh:37:
In file included from /usr/local/include/Geant4/globals.hh:35:
In file included from /usr/local/include/Geant4/G4ios.hh:35:
In file included from /usr/local/include/Geant4/G4Types.hh:74:
In file included from /Users/ME/miniconda3/bin/…/include/c++/v1/complex:245:
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:320:9: error: no member named ‘isinf’ in the global namespace
using ::isinf;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:321:9: error: no member named ‘isnan’ in the global namespace
using ::isnan;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:322:9: error: no member named ‘isnormal’ in the global namespace
using ::isnormal;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:323:9: error: no member named ‘isgreater’ in the global namespace
using ::isgreater;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:324:9: error: no member named ‘isgreaterequal’ in the global namespace
using ::isgreaterequal;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:325:9: error: no member named ‘isless’ in the global namespace
using ::isless;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:326:9: error: no member named ‘islessequal’ in the global namespace
using ::islessequal;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:327:9: error: no member named ‘islessgreater’ in the global namespace
using ::islessgreater;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:328:9: error: no member named ‘isunordered’ in the global namespace
using ::isunordered;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:329:9: error: no member named ‘isunordered’ in the global namespace
using ::isunordered;
~~^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:640:26: error: no template named 'numeric_limits’
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:640:60: error: no template named 'numeric_limits’
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:641:18: error: no template named 'numeric_limits’
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:641:50: error: no template named 'numeric_limits’
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:646:17: error: no template named 'numeric_limits’
static_assert(numeric_limits<_FloatT>::radix == 2, “FloatT has incorrect radix”);
^
/Users/ME/miniconda3/bin/…/include/c++/v1/cmath:649:25: error: no template named 'numeric_limits’
return _FloatBigger ? numeric_limits<_IntT>::max() : (numeric_limits<_IntT>::max() >> _Bits << _Bits);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/exampleB1.dir/exampleB1.cc.o] Error 1
make[1]: *** [CMakeFiles/exampleB1.dir/all] Error 2
make: *** [all] Error 2