Currently we have the installation instructions only  for RHEL-based  Linux  and for OS X.

Using the externals from CVMFS

This is the simpler way to get all the required external packages directly from CVMFS, which are available for a number of predefined platforms (e.g. SLC6, MacOS 10.13, etc.). It requires to have installed CVMFS client, which is the default for CERN lxplus(7) nodes. For MacOS you need to install first Fuse the package ( and then cvmfs one (


Setup a build environment

$ source /cvmfs/[platform]/ where [platform] is the adequate platform label for your system.


Clone, configure and build GeantV package

$ git clone
$ mkdir build
$ cd build
$ cmake ../geant -DCMAKE_INSTALL_PREFIX=[installation directory] 
$ make -j8


Manual installation recipes


For RHEL-based Linux:

  • GCC (version should be greater than 4.8.x, current version is 7.3)
    • It can be obtained from Devtoolsets
      • Before the installation, check if you are  in the sudoers and  if you have installed scl:  yum install scl-utils scl-utils-build
            Also check if you have package/version conflicts (For example: conflict  with preinstalled perf-rt. Workaround: yum remove ..
    • Or build from sources (download the tar file from
      # tar xvfz gcc-x.x.x.tar.gz
      # cd gcc-x.x.x
      # mkdir build
      # cd build
      # ./../configure --prefix=[installation directory] --disable-multilib 
      # make bootstrap MAKE="make -j 4" -j 4
      # make install 

*Change $PATH and $LD_LIBRARY_PATH to access compiled & installed gcc, gfortran, c++ in the .bash_profile file.

export PATH=[installation path for gcc]/bin:$PATH
export LD_LIBRARY_PATH=[installation path for gcc]/lib64:$LD_LIBRARY_PATH

  • CMake > 3.7.0 (!). It can be installed in 2 ways:
    • Check through yum (if OS is providing you the correct version of CMake) # yum install cmake
    • Check the binaries on the web-page:
    • Build from sources: download from or from;O=D
      # tar xvfz cmake-x.x.x.tar.gz
      # cd cmake x.x.x./
      # mkdir build
      # cd build
      # ../bootstrap --prefix=[installation directory]
      # gmake
      # make install

*Change $PATH to access compiled & installed  cmake, ctest in .bash_profile file.

export PATH=[installation path for cmake]/bin:$PATH

  • Required packages for ROOT: # yum install git binutils libX11-devel libXpm-devel libXft-devel libXext-devel
  • Geant4 requirements: # yum install expat expat-devel
  • For OS X:

    • Install Xcode from the AppStore

      • Don't forget to accept the licence $ sudo xcodebuild -license

      • For CMake and other dependencies, you can find also useful these package managers for OS X - MacPorts (, Fink ( or HomeBrew (

        (below is showed an example of installation of HomeBrew and some dependency packages for GeantV)

        $ ruby -e "$(curl -fsSL"
        $ brew doctor
        $ brew install cmake (etc.)l

        To install CMake for OS X check:

      • Use Clang compiler

      • Or compile GCC with C++11 support > starting from 4.8

        $ tar xvfz gcc-x.x.x.tar.gz
        $ cd gcc-x.x.x
        $ mkdir build
        $ cd build
        $ . ../configure --prefix=[installation directory] --disable-multilib 
        $ make bootstrap MAKE="make -j 4" -j 4
        $ make install 

      Update $PATH for gcc to become a default compiler :


      export PATH=[installation dir]/bin:$PATH
      export LD_LIBRARY_PATH=[installation path for gcc]/lib:$LD_LIBRARY_PATH

      to .bash_profile.


    ROOT6 installation

    Use ROOT6 > 6.13.02,

    $ git clone
    $ cd root/
    $ git tag -l
    $ git checkout -b   v6-13-02   v6-13-02 
    (For Mac OS X builds you can use master,
     Mac OS X has Python 2.7 support) 
    $ mkdir build_root
    $ cd build_root

    Check the default build options for ROOT: 

    To enable/disable options just use -D{name_of_option}=ON/OFF

    $ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory]
    -Dc++11=ON -Dgdml=ON
    -Dmathmore=ON -Dbuiltin_gsl=ON 

    MathMore is mandatory for GeantV (Nudy part), if you don't have GSL, ROOT build will be without MathMore part authomatically

    $ make -j{number of cores}
    $ make install


    Manage .bash_profile

    This is the last step (depending on products you are installing)

    Add ROOT & Geant4 specific environmental variables:
    export ROOTSYS=[installation directory]
    export PATH=$PATH:$ROOTSYS/bin
    $[Geant4_installation]/lib64/Geant4-10.4.0/ (check here a correct path)
    Additional values:
    # Geant4 (if you want to run Geant4 examples)
    export G4INSTALL=[installation directory for Geant4]share/Geant4-10.4.0/
    export G4LEVELGAMMADATA=$G4INSTALL/data/PhotonEvaporation2.3
    export G4LEDATA=$G4INSTALL/data/G4EMLOW7.3
    export G4RADIOACTIVEDATA=$G4INSTALL/data/RadioactiveDecay5.2
    # LD_LIBRARY_PATH for other products
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[Geantv install directory]/lib:
    $ROOTSYS/lib:[Geant4 install directory]/lib/Geant4-10.4.0/:
    [VC install directory]/lib:[VecGeom install directory]/lib/:
    [HepMC3 install directory]/HepMC3/lib


    Geant4 installation

    Download the latest release of Geant4 from

    $ tar xvfz geant4_directory.tar.gz
    $ cd geant4_directory/
    $ mkdir build
    $ cd build/
    $ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory] 
    $ make -j4 $ make install

    GEANT4_USE_GDML flag ON is a necessary requirement for GeantV-alpha tag.


VC installation (SIMD library for C++)

We recommend using Vc 1.3.3 or later. Before installing Vc, check/update the binutils package - the version should be at least higher than 2.20 (current version is 2.30)

On SL6 with gcc and with standard binutils, it doesn't work - please use devtoolset!

$ git clone
 $ cd Vc
$ git tag -l
$ git checkout -b 1.3.3 1.3.3
$ mkdir build
$ cd build/
$ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory]
$ make -j4 $ make install 



The recommended version (for GeantV-alpha tag) is VecGeom 00.05.01

$ git clone
$ cd VecGeom
$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory] -DROOT=ON 
-DVECGEOM_VECTOR={sse2 sse3 ssse3  sse4.1 sse4.2  avx  avx2  mic avx512}

For CUDA build you need CUDA <=7.5:


Use additional options if Vc, Geant4, ROOT are not found by CMake modules: -DVc_DIR=[installation directory]/lib/cmake/Vc/

$ make
$ make install

VecGeom for Xeon Phi

If you want to run VecGeom on Xeon Phi, use the latest ICC compiler

Offload mode CMake flags:


Native mode CMake flags:

 -DVc_DIR=[Installation of VC master or 1.3 tag] 


HepMc installation

Clone the git repository (tag beta2.0)

$ git clone
$ cd hepmc3
$ git tag -l
$ export ROOTSYS=[ROOT istallation directory]
$ export PATH=$ROOTSYS/bin
$ git checkout -b beta2.0  beta2.0
$ mkdir builds && cd builds
$ cmake ../ -DCMAKE_INSTALL_PREFIX=<my installation dir> 
-DROOT_DIR=<my ROOT dir>/cmake 

You can also add -DHEPMC_BUILD_EXAMPLES=ON if you want to build the examples.

$ make
$ make install 
You can have a look at for the Doxygen diagram, etc.


GeantV installation

The GeantV engine behavior has to be pre-configured before the initialization phase. A set of general features have to be configured at compile time, using:

cmake -D[feature]=ON/OFF, where the available features are:

- USE_ROOT : enable ROOT support (default ON)

- WITH_GEANT4 : enable Geant4 examples (default ON)

- USE_NUMA : enable topology detection and NUMA-aware binding (default ON), requires hwloc > 1.11

- USE_TBB : enable CMSToyGV example, (default OFF), requires TBB

Clone the project from the CERN gitlab repository:

$ git clone
$ cd geant/
$ mkdir build
$ cd build/
$ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory] 
-DVecGeom_DIR=[installation directory]/lib/CMake/VecGeom
-DHepMC_DIR=<my installation of HepMC3>/cmake/

Add the Geant4 installation directory to CMAKE_PREFIX_PATH if it will not be found automatically.

GeantV instructions

An extended README file describes the main functionalities of the GeantV-alpha tag. Check it out at:

For each example, there is a README file in the GeantV gitlab repository:

  • TestEm3 :

  • TestEm5 :

  • FullCMS :

  • FullLHCb :

  • cmsToyGV :

  • Each of them starts with a self-explanatory summary describing what the application is about.

    TestEm3, TestEm5 and FullCMS applications have a Geant4 equivalent application as well.