- Decide on an install environment, and establish the environment variables. The example for the bash shell follows for CHLEP. You can put these commands into a file called "geant.sh Δ".
export CLHEP_DIR=/cygdrive/c/cygwin/usr/local
export PATH="$PATH:$CLHEP_DIR/bin"
- Install and build CLHEP as per the instructions at (http://www.cern.ch/clhep).
- The environment example for geant4 is
- Geant wants to know where is CLHEP
export CLHEP_BASE_DIR=$CLHEP_DIR
export CLHEP_INCLUDE_DIR=$CLHEP_DIR/include
export CLHEP_LIB_DIR=$CLHEP_DIR/lib
export CLHEP_LIB=CLHEP
- Geant wants to know where is the root build directory
export G4INSTALL=/cygdrive/c/geant4.7.1
export G4INCLUDE=$G4INSTALL/include
export G4LIB=$G4INSTALL/lib
- Now select your system don't use compiler of MSVC++
- Simply go for a straight linux environment
export G4SYSTEM=WIN32-g++
- Now choose where you will put the executables and put them in the path
export G4WORKDIR="$HOME/My Documents/geant4"
export G4TMP=$G4INSTALL/tmp
export PATH="$PATH:$G4WORKDIR/bin/$G4SYSTEM"
- Now select various options ->
export G4LIB_BUILD_STATIC=1
#export G4LIB_USE_GRANULAR=1
export G4DEBUG=1
- to use the debugger or not
export G4OPTIMISE=' '
- We will use ROOT to analyse not JAG or AIDA
export G4ANALYSIS_USE=0
export G4UI_USE_ROOT=1
#export G4UI_USE_TCSH=1
export G4UI_USE_TERMINAL=1
export G4UI_USE_GAG=1
export G4UI_USE_XAW=1
export G4UI_USE_WO=1
#export G4VIS_USE_OIX=0
#export G4VIS_USE_DAWN=1
#export G4VIS_USE_VRML=1
- This prepares for Open GL build
export OGLHOME=/usr/X11R6
export G4VIS_BUILD_OPENGLX_DRIVER=1
- Choose non-permanent graphics window, low memory option
export G4VIS_USE_OPENGLX=1
#export G4VIS_USE_OPENGLXM=1
- Start a new X-shell and make sure your environment variables come through (use shell scripts to automate their setting). Build geant4 (after reading about installation procedures at http://geant4.cern.ch/ just by saying (in the geant source directory)
make
- Then test, by going to the novice N03 example tree and saying
make
- You can add a new visualisation manager by the following minimal rebuild of the visualisation system
touch $G4INSTALL/source/visualization/management/src/G4VisManager.cc
cd $G4INSTALL/source/visualization/OpenGL; make clean
cd $G4INSTALL/source/interfaces; make clean
cd $G4INSTALL/source/; make
- Rebuild the your application as follows:
cd /path/to/example
gmake clean
gmake
- For example, from the GEANT4 www-page, you can follow the link to the Installation Introduction, and from there to the Dawn pages, and get Dawn working as well.