How to run the GEANT4 examples on Linux

In order to compile, link and run the GEANT4 examples, a number of env. variables must be set. I copied and modified a script by Andrea Dellacqua that does just that. The script is at /home/stratos/geant4 /
So, log into one of the linux hosts (, N=1,2,3,4) or your AFS client Linux box, and in your home directory create a geant4 subdirectory:
bash>mkdir $HOME/geant4 
bash>cd $HOME/geant4
Copy the setup script and execute it. is good for the bash shell. If you are using a different shell, you must make the appropriate changes.
bash>cp /home/stratos/geant4/ .
export G4INSTALL=/afs/rhic/usatlas/software/geant4/Linux/geant4.0.1
export CLHEP_BASE_DIR=/afs/rhic/usatlas/software/geant4/Linux/CLHEP/Linux-g++/1.3
export RWBASE=/afs/rhic/usatlas/software/geant4/Linux/rogue
export G4VIS_USE_DAWN=1
export G4SYSTEM=Linux-g++
export G4WORKDIR=$HOME/geant4
export G4DAWN_HOME=/afs/rhic/usatlas/software/geant4/Linux/DAWN
export DAWN_HOME=/afs/rhic/usatlas/software/geant4/Linux/DAWN
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
The examples are located at $G4INSTALL/examples. For a dercription what each example does, read the README file at the example's directory. For those examples that use graphics we use DAWN. To compile a particular example (N01), create a N01 subdirectory off your $G4WORKDIR and copy everything from the corresponding example directory at the AFS area:
bash>mkdir $G4WORKDIR/N01
bash>cd $G4WORKDIR/N01
bash>cp -r $G4INSTALL/examples/novice/N01/* .
Now from $G4WORKDIR/N01 do
gmake will create the directories $G4WORKDIR/bin/Linux-g++ and $G4WORKDIR/tmp/Linux-g++. To run the example you just compiled, from your example directory ($G4WORKDIR/N01), do:



Send me email: Stratos