# Manual Installation of geant4 on macOS # Will require about 3GB of storage space including Geant4 datasets # System software required by geant4 xcode-select --install brew install cmake qt6 expat # Create your workspace folder and enter the folder, e.g. mkdir -p $HOME/software/geant4 && cd $_ # Download Geant4 distribution GEANT_RELEASE=v11.4.0 wget https://gitlab.cern.ch/geant4/geant4/-/archive/${GEANT_RELEASE}/geant4-${GEANT_RELEASE}.tar.gz # If download successful, uncompress the archive tar zxvf geant4-${GEANT_RELEASE}.tar.gz # create build directory mv geant4-${GEANT_RELEASE}{,-src} mkdir geant4-${GEANT_RELEASE}{,-build} cd geant4-${GEANT_RELEASE}-build # Now prepare makefiles with cmake cmake -DCMAKE_INSTALL_PREFIX=../geant4-${GEANT_RELEASE} \ -DGEANT4_BUILD_MULTITHREADED=OFF \ -DGEANT4_INSTALL_DATA=OFF \ -DGEANT4_USE_QT=ON ../geant4-${GEANT_RELEASE}-src # now compile and install make -jN ## (e.g N=4 based on the number of cores on your system) make install # Installation complete! # Copy GEANT4 datasets (OPTIONAL) # Warning! Large amount of data will be downloaded # Check if you can copy the datasets offline mkdir -p ../geant4-${GEANT_RELEASE}/share/Geant4/data && cd $_ for dset in $(echo https://cern.ch/geant4-data/datasets/G4NDL.4.7.1.tar.gz \ https://cern.ch/geant4-data/datasets/G4EMLOW.8.8.tar.gz \ https://cern.ch/geant4-data/datasets/G4PhotonEvaporation.6.1.2.tar.gz \ https://cern.ch/geant4-data/datasets/G4RadioactiveDecay.6.1.2.tar.gz \ https://cern.ch/geant4-data/datasets/G4PARTICLEXS.4.2.tar.gz \ https://cern.ch/geant4-data/datasets/G4PII.1.3.tar.gz \ https://cern.ch/geant4-data/datasets/G4RealSurface.2.2.tar.gz \ https://cern.ch/geant4-data/datasets/G4SAIDDATA.2.0.tar.gz \ https://cern.ch/geant4-data/datasets/G4ABLA.3.3.tar.gz \ https://cern.ch/geant4-data/datasets/G4INCL.1.3.tar.gz \ https://cern.ch/geant4-data/datasets/G4ENSDFSTATE.3.0.tar.gz) do wget $dset && tar zxvf $(basename $dset) done # After successful installation of geant4, build applications (e.g B1) cd $HOME/software/geant4 # copy the examples folder from the geant4 src directory rsync -avz --progress geant4-${GEANT_RELEASE}-src/examples . cd examples/basic mkdir -p B1-build && cd $_ cmake -DCMAKE_PREFIX_PATH=$HOME/software/geant4/geant4-${GEANT_RELEASE} ../B1 make # finally, you can run the example now # Note that, geant4 datasets should be available by now source $HOME/software/geant4/geant4-${GEANT_RELEASE}/bin/geant4.sh ./exampleB1