I use macports to install supplemental softwares:
sudo port -v install cmake (necessary)
sudo port -v install iAIDA (optional, I was just curious)
sudo port -v install xercesc3 (needed for GDML)
I downloaded the newest available source from cern Source Download Page.
I am going to install it in /usr/local/geant4:
$ sudo mkdir /usr/local/geant4
$ cd /usr/local/geant4
$ mkdir build4.9.6.p02
$ sudo mv ~/Downloads/geant* ./
$ sudo tar -xvf geant4.9.6.p02.tar
$ cd build4.9.6.p02
$ls -lO /
$sudo chflags nohidden /usr (to see files on finder)
$export G4INSTALL=/usr/local/geant4/geant4.9.6.p02
Now we use cmake
$sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DXERCESC_ROOT_DIR=/opt/local -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_QT=ON $G4INSTALLFor build options, refer to section 2.3 in geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/fo/BookInstalGuide.pdf
Now proceed usual make:
$sudo make -j4
$sudo make install
$ls -lO /
$sudo chflags hidden /usr (to hide /usr from finder)
$cd /my/private/directory
$mkdir B1-build
$cd B1-build
$source /usr/local/bin/geant4.sh
$cmake -DGeant4_DIR=/usr/local/lib/Geant4-9.6.2 $G4INSTALL/examples/basic/B1
$make
$./exampleB1
Build another example which requires a slight different targeting:
$cd ..
$mkdir rdecay01-build
$cd rdecay01-build
$cmake -DGeant4_DIR=/usr/local/lib/Geant4-9.6.2 $G4INSTALL/examples/extended/radioactivedecay/rdecay01
That's it.
#This installation was performed after an unsuccessful installation of a macports distribution of geant4.9.4 by
$sudo port -v install geant4 +aida +gdml +raytracerx
Precisely speaking, the installation process was successful. However, when I try to build an example, clang called in Darwin-g++.gmk couldn't find files such as libgcov.a in my OS X 10.8 system to generate a library. I therefore uninstalled the macports distributed geant4.9.4.p02 from my system.
No comments:
Post a Comment