Download the Geant4 sources from the distribution page.

Once you have obtained the sources, please read the Installation Guide carefully.

The following sequence of commands should get you up and running on Linux (using bash shell).

export CLHEP_BASE_DIR=/your/path/to/clhep
tar -zxvf geant4.x.tar.gz
cd geant4.x
export G4INSTALL=$(pwd)
export G4WORKDIR=$(pwd)
export G4SYSTEM=Linux-g++
cd geant4.x/source
make includes

This will take up to several hours depending on the speed of your machine.

Next, try to build an example application.

cd geant4.x/examples/novice/N03
export G4WORKDIR=$(pwd)
make all

Now you should have the ./bin/Linux-g++/N03 binary.

  • No labels