Using the SLAC Installation of the Geant4 Toolkit

Last modified :

Current Installation

The latest Geant4 libraries are centrally maintained and installed so that users may build and link their applications to them, rather than build and maintain their own libraries.

Geant4 10.2 is now installed on the 32-bit and 64-bit Linux machines: Older libraries, from Geant4 9.0 (patch02) onward, may also be accessed. The previous version of this document is also available.

Various data files required for optional Geant4 processes and models are also centrally maintained and automatically accessed by the setup scripts.

Accessing the SLAC installation

To compile and link a simulation executable using the current Geant4 toolkit, several environment variables must first be set. This is done in a script which also chooses the combination of Geant4 libraries appropriate to the computing platform. The scripts available for each machine are: To begin: Here rhel6-64 was chosen as it is likely the most used platform.

The essential variables set by this file are: Setup scripts for old versions are also available in /afs/slac/package/geant4/9.4.p03, 9.3.p02, and so on.


Interfaces for several visualization drivers have been compiled into the toolkit libraries. Currently the setup scripts choose OPENGL, but the user may choose another driver by setting the appropriate environment variable before building the executable. File-based visualization (that which writes output to .jpg, .gif, etc.) is also supported.

Building and Running the Executable

The following steps will lead you to a working executable with visualization using OPENGL. First, be sure that the environment is set. If you haven't already done so, do one of the following: The multithreading and debug libraries are available on the rhel6-64 system. They may be accessed as follows: Next, you may use either cmake or gmake to build an executable: If everything goes according to plan, you should see the Idle> prompt on your screen (after some preliminary output). From this prompt type At this point you are ready to add to and modify the code in your copy of B4a. For more information about developing your own simulation code using Geant4, see the Application Developer's Guide .
Dennis Wright
Tatsumi Koi