Apologies if this question has been answered somewhere else, but I have been searching for days and have not found a solution yet. I recently got a new Macbook and cannot get previously working simulations to build.
Geant4 Version: 11.2.2
Operating System: macOS Sonoma 14.5
Compiler/Version: Apple clang version 15.0.0 (clang-1500.3.9.4)
CMake Version: 3.30.1
Qt Version: 5.15.13_1
I have successfully built Geant4, but only by setting CMAKE_OSX_ARCHITECTURES to x86_64. Leaving this field empty, or setting it to arm64 prevents the build of Geant4 from succeeding. Below is a screenshot of my ccmake parameter definitions.
Both commands “make” and “make install” complete without incident for the Geant4 build process.
I then source /Users/mackenziemoring/software/geant4-v11.2.2-install/share/Geant4/geant4make/geant4make.sh in my terminal where I am building my simulation.
Then, when I run “cmake …” inside my build directory for my simulation, I receive warnings, but no errors, and the build files are written to the correct directory. The output of cmake is available here simulation_cmake_output.txt (4.2 KB).
I then run “make” within the build directory for my simulation and receive errors related to missing architecture. The output of “make VERBOSE=1” is here simulation_make_output.txt (75.4 KB).
Other notes: I have installed command line tools for Xcode and I have also installed Rosetta 2.
If anyone has any ideas or guidance I would really appreciate it. Thank you in advance,
Just to take a step back, could you post the errors/messages you’re seeing when trying to build Geant4 itself with CMAKE_OSX_ARCHITECTURES left empty or set to arm64 please? It nominally should be fine here, so would be good to understand what’s going wrong here first.
Thanks! Taking a look through the crucial line(s) are here:
[ 11%] Building CXX object source/CMakeFiles/G4geometry.dir/geometry/biasing/src/G4IStore.cc.o
ld: warning: ignoring file '/usr/local/Cellar/qt@5/5.15.13_1/lib/QtCore.framework/Versions/5/QtCore': found architecture 'x86_64', required architecture 'arm64'
So your Homebrew install has x86 binaries rather than the needed arm64 ones. Unless you have very good reason to keep the Homebrew in /usr/local around, it’s going to be easiest to upgrade Homebrew to migrate it from Intel to Arm. I think that can be done with a brew upgrade and that might suggest what to do, but failing that it should be o.k. to just uninstall the Homebrew in /usr/local and then install again to get the arm64 version (which would install to /opt/homebrew. There’s an old thread here which might help, especially it you do the migration and want to easily reinstall the Formulae/Taps you already have.