Geant4 on MacOS X

Geant4 compiles and runs on MacOS X 10.4. The following is how I did it. Take a look also at Kotoyo Hoshina's Geant4 installation note for more information.

Preparation

Install gcc and cernlib following the instructions given in the GFORTRAN page and the CERNLIB page, if you haven't. In addition geant4 depends on CLHEP. Install it as

$ su
# apt-get update
# apt-get install clhep
# exit

[1] Compilation Conditions

MacOS X Release 10.4.2
standard Mach Kernel (Darwin 8.3.0)
gcc-4.1.0-svn20051124b.ppc.rpm
Apple's X11 for MacOS X
CERNLIB-2005
clhep-2.0.2.2-1a.ppc.rpm
[2] Compilation Procedure

First download all of the necessary source files from the GEANT4 site and my private patches: gfortran patch and PropagatorInField patch into a directory, <somewhere>.

$ ls <somewhere>
G4ELASTIC.1.1.tar.gz
G4EMLOW.3.0.tar.gz
G4NDL3.8.tar.gz
PhotonEvaporation.2.0.tar.gz
RadiativeDecay.3.0.tar.gz
geant4.8.0.p01.gtar.gz
geant4.7.1.p01-gfortran.patch
geant4.8.0.p01-G4PropagatorInField.patch

Then expand the source tarballs as follows in whatever directory you want to install GEANT4.

$ tar -zxvf <somewhere>/geant4.8.0.p01.gtar.gz
$ cd geant4.8.0.p01
$ patch -p1 -s < <somewhere>/geant4.7.0.p01-gfortran.patch
$ patch -p1 -s < <somewhere>/geant4.8.0.p01-G4PropagatorInField.patch
$ mkdir data
$ for i in <somewhere>/*.tar.gz; do tar -zxvf $i -C data; done
$ ./Configure -build
....
.... answer questions (default answers should work for most people)
....
.... compilation begins and after a long time it will finish
....
$ cd sources
$ make includes
$ cd ../physics_lists/hadronic
$ make >& make.log &
^C

[3] Test Run

Try exapmles in the "examples" directory.


Back to Keisuke Fujii's HEP on X Page
keisuke.fujii@kek.jp October 15, 2005