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 (linux00N.usatlas.bnl.gov, N=1,2,3,4) or
your AFS client Linux box, and in your
home directory create a geant4 subdirectory:
Copy the setup script G4setup_linux.sh and execute it. G4setup_linux.sh
is good for the bash shell. If you are using a different shell, you must make
the appropriate changes.
bash>cp /home/stratos/geant4/G4setup_linux.sh .
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>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:
- Examples N03 and N05 use graphics. When you run either of them from your $G4WORKDIR/N03 directory,
at the Idle> prompt, you must type:
Idle>/vis~/create_view/new_graphics_system DAWN (the character after /vis is a tilde, not a dash!)
- For more examples, look at the course material by Andreas Dellacqu which I put at:
Send me email: