2. How To Compile#

2.1. Source code#

Get the latest, stable version (master branch or a specific tag) from CERN GitLab:

  • clone the repo (you are automatically on master branch):

    git clone --recursive https://gitlab.cern.ch/g4see/g4see.git
    
    • Please note: --recursive option is needed to clone embedded git repositories (git submodules) as well

    • Other method:

      git clone https://gitlab.cern.ch/g4see/g4see.git
      git submodule init
      git submodule update --remote
      
    • (optional) switch to a specific tag (release): git checkout tags/v0.5

    • (optional) switch to a specific branch: git checkout <branch>

    • pull latest changes from remote repository: git pull

2.2. Dependencies#

  • Geant4 (>= 10.7.0, recommended version: 11.0.3)

  • CMake (>= 3.17)

  • Python (>= 3.8, recommended version: 3.10)

    • See python package dependencies in g4see-scripts/requirements.txt

2.3. Build & Compile#

Build command-line with cmake, then compile with make. Starting from your local g4see/ repository root folder:

mkdir build && cd build
export G4LIB=<Geant4_installation_path>/lib64/Geant4-<version>/
cmake -DGeant4_DIR=$G4LIB ..
make -j [number_of_jobs]
sudo make install
  • To compile a single-threaded G4SEE app (instead of a multi-threaded), use optional -DMULTITHREADED=False flag for cmake (default: True)

  • make install is optional, it copies g4see and mergeHistograms executables into /usr/local/bin/ directory

Executables:

  • build/g4see

  • build/mergeHistograms

  • build/scripts/g4see.py {submit,delete,view,merge,plot}

    • submit Submit jobs to cluster nodes

    • delete Delete jobs submitted to cluster nodes

    • view Visualize geometry from macro file

    • merge Merge histogram files recursively

    • plot Plot histograms from files

See How To Run the G4SEE toolkit.