Installation

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

Installation requirements

 

For RHEL-based Linux:

  • GCC (version should be more then 4.8.x, current version is 5.3)
    • Can be obtained from Devtoolsets
      • Before installation check if you are  in the sudoers and 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 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 for access compiled & installed gcc, gfortran, c++ in .bash_profile

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

Remark from Federico:

"If you have gcc 4.9 and higher you need to make the following change in cmake:

add -ltinfo at the end of the single line in the file Source/CMakeFiles/ccmake.dir/link.txt"

  • Cmake > only higher 3.1.0 (!!!), if you want use VecGeom and can be be installed in 2 ways:

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

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 AppStore

      • Dont forget to accept licence $ sudo xcodebuild -license

      • For CMake and other dependencies, you can find also usefull package manager for OS X - MacPorts (https://www.macports.org/install.php), Fink (http://finkproject.org/download/) or HomeBrew (http://brew.sh/)

        (bellow is showed case of installation HomeBrew and dependency packages for GeantV)

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

        For installation of cmake for OS X check: http://cmake.org/cmake/resources/software.html

      • Use Clang compiler

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

        $ 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 only ROOT6 with a tag v6-06-06 or up,

    $ git clone http://root.cern.ch/git/root.git
    $ cd root/
    $ git tag -l
    $ git checkout -b   v6-06-06   v6-06-06 
    (For Mac OS X builds you can use master,
     Mac OS X has Python 2.7 support) 
    $ mkdir build_root
    $ cd build_root

    Check default build options for ROOT:

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

    For enabling/disabling 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 are 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

    You need to do this at the last step (depends of products are you 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.1.0/ (check here a correct path)
    Additional values used for generation tabulated physics or for additional manipulations..
    # Geant4 (if you want to run Geant4 examples or GeantV  tabxsec)
    export G4INSTALL=[installation directory for Geant4]share/Geant4-10.1.0/
    export G4LEVELGAMMADATA=$G4INSTALL/data/PhotonEvaporation2.3
    export G4NEUTRONXSDATA=$G4INSTALL/data/G4NEUTRONXS1.4
    export G4LEDATA=$G4INSTALL/data/G4EMLOW6.39
    export G4SAIDXSDATA=$G4INSTALL/data/G4SAIDDATA1.1
    export G4RADIOACTIVEDATA=$G4INSTALL/data/RadioactiveDecay3.6
    export G4NEUTRONHPDATA=$G4INSTALL/data/G4NDL4.2
     
    # LD_LIBRARY_PATH for other products
     
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[Geantv install directory]/lib:
    $ROOTSYS/lib:[Pythia install directory]/lib/:[Geant4 install directory]/lib/Geant4-10.1.0/:
    [VC install directory]/lib:[VecGeom install directory]/lib/:
    [HepMC3 install directory]/HepMC3/lib

     

    Geant4 installation

    Use last tarball (Geant4-10.3p01) 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

     

VC installation (SIMD library for C++)

    Check/update binutils package - version should be at least higher then 2.20 (current version is 2.24)

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

    $ git clone https://github.com/VcDevel/Vc.git
     $ cd Vc
    $ git tag -l
    $ git checkout -b 1.3.0 1.3.0 (please select this tag or 1.2.0, as a requirement to VecCore and VecPhys)
    $ mkdir build
    $ cd build/
    $ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory]
    $ make -j4 $ make install 

     

    VecGeom

    $ 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 wasn't 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 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

     

    Pythia8 installation

    Present (!!!) version that supported by LHC experiments is PYTHIA 8.186 http://home.thep.lu.se/~torbjorn/pythiaaux/present.html

    Please notice that if you will install Pythia 8.200, it is not well supported by ROOT ( for option -DPYTHIA=ON for ROOT installation), but for GEANT-V installation it is also acceptable version.

    $ wget http://home.thep.lu.se/~torbjorn/pythia8/pythia8186.tgz or
    $ wget http://home.thep.lu.se/~torbjorn/pythia8/pythia8186.tgz
    $ cd pythia8xxx 
    $ ./configure --prefix=[where to install] --enable-shared
    $ make
    $ make install

     

    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 and -DPYTHIA8_ROOT_DIR=[installation of Pythia8] if you want to build the Pythia8 example in particular.

    $ make
    $ make install 
    You can have a look at http://hepmc.web.cern.ch/hepmc/ for the Doxygen diagram, etc.

     

    Geant-V installation

    Currently in case of master branch:

    $ git clone https://gitlab.cern.ch/GeantV/geant.git
    $ cd GeantV/
    $ mkdir build
    $ cd build/
    $ cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory] 
    -DUSE_VECGEOM_NAVIGATOR=ON
    -DVecGeom_DIR=[installation directory]/lib/CMake/VecGeom
    -DCMAKE_CXX_FLAGS="-O2 -std=c++11"  
    -DUSE_ROOT=ON
    -DHepMC_DIR=<my installation of HepMC3>/cmake/
    -DPYTHIA8_ROOT_DIR=[PYTHIA8_dir]
    -DCMAKE_PREFIX_PATH=[VC_dir]/lib/cmake/Vc

    You add Geant4 installation directory to CMAKE_PREFIX_PATH in case if it will not be find automatically.

    (-DUSE_VECGEOM_NAVIGATOR=ON for usage VecGeom navigation, without this option - will use TGeo navigation )

    Also to build Geant for debugging purposes you need to add: -DBUG_HUNT=ON

    In case if you want to to run CUDA build, just use next CMake configuration:

    cmake ../ -DCMAKE_INSTALL_PREFIX=[installation directory]  
    -DHepMC_DIR=<my installation of HepMC3>/cmake/
    -DVecGeom_DIR=[installation directory of VecGeom CUDA]/lib/CMake/VecGeom
    -DCUDA=ON  -DVECGEOM_NAVIGATOR=ON
    -DPYTHIA8_ROOT_DIR=[PYTHIA8_dir]
    -DCMAKE_PREFIX_PATH=[VC_dir]/lib/cmake/Vc

    Special physics lists (files to download)

    These files should be located in <GeantV install directory>/vecprot_v2/

    To download files please use click of right button of mouse and select "Save link as.."

    Currently we are working with xsec_FTFP_BERT.root and fstate_FTFP_BERT.root xsec_FTFP_BERT_G496p02_10mev.root and fstate_FTFP_BERT_G496p02_10mev.root also special cuts xsec_FTFP_BERT_G496p02_1mev.root and fstate_FTFP_BERT_G496p02_1mev.root

    Geometry: ExN03.root

     

    Extra HepMC3 event files

    The next three files correspond to minBias, minBias with pTHat min 50GeV and ttbar events. Each file contains one thousand events. These files have been produced with the beta1.0 version of HepMC3. This is the recommended version to be used with Geant-V (these files may not be readable with some old tags of HepMC3). To download files please use click of right button of mouse and select "Save link as.."

    ROOT format:

  • minbias_14TeV.root
  • minbias_pT50_14TeV.root
  • ttbar_14TeV.root
  • And .hepmc3 format:

  • minbias_14TeV.hepmcs
  • minbias_pT50_14TeV.hepmc3
  • ttbar_14TeV.hepmc3
  •  

    How to run GeantV exampleN03

  • You need to set the VP_GEOM_GDML, VP_DATA_XSEC and VP_DATA_FSTAT env. variables to the test-small-10Layers-Scintilator.gdml (that is in /geant/test-small/gdml/), xsec_FTFP_BERT.root and fstate_FTFP_BERT.root files respectively.
  • Comment out everything in exampleN03.in that doesn't belong to the first run i.e.:
    # e+ 300MeV
    /gun/particle e+
    /gun/energy 300 MeV
    /run/beamOn 1
    #
    # list the existing physics processes
    /process/list
    #
    # switch off MultipleScattering
    /process/inactivate msc
    /run/beamOn 1
    #
    # switch on MultipleScattering
    /process/activate msc
    #
    # change detector parameter
    /N03/det/setAbsMat Aluminium
    /N03/det/setGapMat Aerogel
    /N03/det/setAbsThick 2. cm
    /N03/det/setGapThick 5. cm
    /N03/det/setNbOfLayers 30
    /N03/det/setSizeYZ 1.5 m
    /N03/det/update
    /gun/particle gamma
    /gun/energy 500 MeV
    /run/beamOn 1
  • Run exampleN03 as . /bin/exampleN03 exampleN03.in

 

How to run GeantV prototype

You can run this application as a root macro by :

root -q [source_dir_GeantV]/vecprot_v2/run.C

In case of CUDA build: root -q [source_dir_GeantV]/vecprot_v2/runGPU.C

Before running this GeantV application have a look at /vecprot_v2/run.C and make sure that: 

  1. geomfile = "/where/your/ExN03.root"
  2. xsec = "/where/your/xsec_FTFP_BERT_G496p02.root"
  3. state = "/where/your/fstate_FTFP_BERT_G496p02.root"

You can also run CMS application as a root macro by (currently works only with TGeo navigator) :

root -q [source_dir_GeantV]/vecprot_v2/runCMS.C

Before running this GeantV application have a look at /vecprot_v2/runCMS.C and make sure that you have downloaded and located correctly: 

  1. xsec_FTFP_BERT_G496p02_1mev.root
  2. fstate_FTFP_BERT_G496p02_1mev.root
  3. And pp14TeVminbias.root file

How to run GeantV prototype with HepMC generator

You can run this application as a root macro by :

root -q [source_dir_GeantV]/vecprot_v2/runHepMC.C

Before running this GeantV application have a look at /vecprot_v2/runHepMC.C and make sure that: 

prop->fPrimaryGenerator = new HepMCGenerator("pp14TeVminbias.root”)

with correct location of pp14TeVminbias.root file.

The input file with the events can get from /afs/cern.ch/user/w/witoldp/public or from pp14TEvminbias.root and pp14TEvminbias.hepmc3.

To download files please use click of right button of mouse and select "Save link as.."

You have there two files, ASCII and Root. They both contain 100 Pythia8 pp at 14TeV minimum bias events with no filtering what so ever. The HepMC interface in GeantV can read both formats. Of course, there is no reason to use the ascii format if you can use root. (ROOT I/O is now part of HepMC3, which is a big advantage over HepMC2 which was lacking it)

How to run test-complex

You can run this application as a binary located in [Geantv_sources]/bin using specific script testcomplex.sh.

You need to export two environmental variables VP_DATA_XSEC and VP_DATA_FSTA with xsec and fstate file from "Special physics lists (files to download)"

Please before to run, change testcomplex.sh script with appropriate values and paths:

1.GEOMFILE with appropriate path to cms2015.gdml

2.EVENTFILE with a path to new pp14TeVminbias.root

3.GEANTMACRO with a path to g4macro_TPHYS.mac (it is located in [GeantV_sources/bin])

4.LOWENERGYCUT with appropriate number of energy cuts that you were using (in GeV)

#################################################################
# GDML Geomtery File 
GEOMFILE="/where/is/your/cms2015.gdml"
#################################################################
 
#################################################################
# ROOT file that contains the pre-generated primary events
EVENTFILE="/wher/is/your/pp14TeVminbias.root"
#################################################################
 
#################################################################
# Geant4 macro file with some Geant4 commands
GEANTMACRO="/where/is/your/g4macro_TPHYS.mac" 
#################################################################
 
#################################################################
# Low energy cut value given in GeV units
LOWENERGYCUT="0.01"
#################################################################
 
#################################################################
# (OPTIONAL) Physics list name: Tabulated physics is the default
PHYSLISTNAME="TABPHYS"
#################################################################
#################################################################
# Set the required score type (0 is default i.e. no scoring)
SCORETYPEFLAG="0"
#################################################################
 ./testcomplex \
 --geomFile $GEOMFILE \
 --eventFile $EVENTFILE \
 --geantMacro $GEANTMACRO \
 --lowEnergyCut $LOWENERGYCUT \
 --physListName $PHYSLISTNAME \
 --scoreType $SCORETYPEFLAG

In case of problems don't forget to check: ./[Geantv_sources]/bin/testcomplex --info