Installation

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 (https://osxfuse.github.io) and then cvmfs one (https://cernvm.cern.ch/portal/filesystem/downloads).

 

Setup a build environment

$ source /cvmfs/sft.cern.ch/lcg/views/geant-latest/[platform]/setup.sh where [platform] is the adequate platform label for your system.

 

Clone, configure and build GeantV package

$ git clone https://gitlab.cern.ch/GeantV/geant.git
$ 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 http://gcc.gnu.org/mirrors.html):
      # tar xvfz gcc-x.x.x.tar.gz
      # cd gcc-x.x.x
      # mkdir build
      # cd build
      # ./../configure --prefix=[installation directory] --disable-multilib 
      --enable-languages=c++,fortran
      # 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: https://cmake.org/download/
    • Build from sources: download from http://cmake.org/cmake/resources/software.html or from http://www.cmake.org/files/dev/?C=M;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 (https://www.macports.org/install.php), Fink (http://finkproject.org/download/) or HomeBrew (http://brew.sh/)

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

        $ ruby -e "$(curl -fsSL 
        https://raw.githubusercontent.com/Homebrew/install/master/install)"
        $ brew doctor
        $ brew install cmake (etc.)l

        To install CMake for OS X check: http://cmake.org/cmake/resources/software.html

      • 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 
        --enable-languages=c++,fortran
        $ make bootstrap MAKE="make -j 4" -j 4
        $ make install 

      Update $PATH for gcc to become a default compiler :

      add

      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 http://root.cern.ch/git/root.git
    $ 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:

     http://root.cern.ch/drupal/content/building-root-cmake 

    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
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib:
    $[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 G4NEUTRONXSDATA=$G4INSTALL/data/G4NEUTRONXS1.4
    export G4LEDATA=$G4INSTALL/data/G4EMLOW7.3
    export G4SAIDXSDATA=$G4INSTALL/data/G4SAIDDATA1.1
    export G4RADIOACTIVEDATA=$G4INSTALL/data/RadioactiveDecay5.2
    export G4NEUTRONHPDATA=$G4INSTALL/data/G4NDL4.5
    export G4ENSDFSTATEDATA=$G4INSTALL/data/G4ENSDFSTATE2.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 http://geant4.web.cern.ch/geant4/support/download.shtml

    $ tar xvfz geant4_directory.tar.gz
    $ cd geant4_directory/
    $ mkdir build
    $ cd build/
    $ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory] 
    -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON
    -DXERCESC_ROOT_DIR=[path_to_library/includes]
    $ 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 https://github.com/VcDevel/Vc.git
 $ 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 

 

VecGeom

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

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

For CUDA build you need CUDA <=7.5:

-DBackend={Scalar, Vc}  -DCUDA=ON -DNO_SPECIALIZATION=ON
-DCUDA_VOLUME_SPECIALIZATION=OFF 

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:

 -DBACKEND=Scalar -DOFFLOAD_MODE=ON

Native mode CMake flags:

 -DVc_DIR=[Installation of VC master or 1.3 tag] 
-DBACKEND=Vc -DVECGEOM_VECTOR=mic

 

HepMc installation

Clone the git repository (tag beta2.0)

$ git clone https://gitlab.cern.ch/hepmc/HepMC3.git
$ 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 http://hepmc.web.cern.ch/hepmc/ 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 https://gitlab.cern.ch/GeantV/geant.git
$ 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/
-DCMAKE_PREFIX_PATH=[VC_dir]/lib/cmake/Vc

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: https://gitlab.cern.ch/GeantV/geant/blob/master/README

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

  • TestEm3 : https://gitlab.cern.ch/GeantV/geant/blob/master/examples/physics/TestEm3...

  • TestEm5 : https://gitlab.cern.ch/GeantV/geant/blob/master/examples/physics/TestEm5...

  • FullCMS : https://gitlab.cern.ch/GeantV/geant/blob/master/examples/physics/FullCMS...

  • FullLHCb : https://gitlab.cern.ch/GeantV/geant/blob/master/examples/physics/FullLHC...

  • cmsToyGV : https://gitlab.cern.ch/GeantV/geant/blob/master/examples/physics/cmsToyG...

  • 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.