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 (e.g. x86_64-centos7-gcc7-opt, x86_64-mac1013-clang91-opt, ...)

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] -DCTEST=ON
make -j8

Installation of all the externals locally

In case you do not want to depend on CVMFS and be able to develop while disconnected from the network you can install the required externals packages locally. The following instructions shows how to do it:

#---install lcgcmake
git clone https://gitlab.cern.ch/sft/lcgcmake.git
export PATH=$PWD/lcgcmake/bin:$PATH

#---prepare a working area
mkdir build
cd build

#---configure your software stack
lcgcmake config --prefix <prefix> --compiler gcc7 --version geantvext20181218
lcgcmake install GeantV-externals

You can customise your software stack by changing the compiler version and the LCG stack version. Use the command lcgcmake show compilers or lcgcmake show versions to see what options exist.
To setup a running environment you can source <prefix>/geantvext20181218/x86_64-centos7-gcc7-opt/setup.sh or simply execute lcgcmake run. Then proceed a usual to build and run the tests.

git clone https://gitlab.cern.ch/GeantV/geant.git
mkdir build
cd build
cmake ../geant -DCMAKE_INSTALL_PREFIX=[installation directory] -DCTEST=ON
make -j8
ctest

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:

  • 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.)
    
  • 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 by adding export PATH=[installation dir]/bin:$PATH export LD_LIBRARY_PATH=[installation path for gcc]/lib:$LD_LIBRARY_PATH to .bash_profile.

ROOT 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 automatically

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/support/download

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

VecCore

git clone https://github.com/root-project/veccore.git
cd veccore
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory] -DROOT=ON 
-DBACKEND=Vc -DVc_DIR=[installation directory]/lib/cmake/Vc/

This setting is using Vc Backend, but you can select also Scalar and other. For CUDA build you need CUDA <=7.5:

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

make
make install

VecMath

git clone https://github.com/root-project/vecmath.git
cd vecmath
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory] -DROOT=ON 
-DBACKEND=Vc -DVc_DIR=[installation directory]/lib/cmake/Vc/
make
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

This setting is using Vc Backend, but you can select also Scalar and other. For CUDA build you need CUDA <=7.5:

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

Use additional option if Vc is not found by CMake modules:

-DVc_DIR=[installation directory]/lib/cmake/Vc/
make
make install

HepMc installation

Clone the git repository https://gitlab.cern.ch/hepmc/HepMC3.git (tag 3.0.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 3.0.0  3.0.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] \
-DVc_DIR=$VecCore_INSTALL/lib/cmake/Vc \
-DVecCore_DIR=$VecCore_INSTALL/share/VecCore/cmake \
-DVecCoreLib_DIR=$VecCoreLib_INSTALL/lib/cmake/VecCoreLib \
-DVecGeom_DIR=[installation directory]/lib/CMake/VecGeom \
-DHepMC_DIR=<my installation of HepMC3>/cmake/ \
-DGeant4_DIR=$G4_INSTALL/lib/geant4.10.04.p02 \
-DUSE_ROOT=ON \
-DWITH_GEANT4=ON \
-DBUILD_REAL_PHYSICS_TESTS=ON

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:

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.