CLHEP is intended to be a set of HEP-specific foundation and utility classes such as random generators, physics vectors, geometry and linear algebra.
CLHEP is structured in a set of packages independent of any external package.
Geant4 requires the
CLHEP libraries in order to compile simulations.
Geant4 distributes a minimal version of the
CLHEP library sources with the toolkit to help cross-platform usage.
This internal version of the CLHEP library is built and used by default, so having an external install of CLHEP is no longer a prerequisite for Geant4.
However, the BDSIM accelerator simulation toolkit, which uses Geant4 for particle-matter interactions, requires a standalone version of
CLHEP to be compiled separately from
As such, the instructions below relate to the standalone version of
- Source URL
- Installed Production version
- 126.96.36.199 (15 Mar 2016)
- Source code
- Installed Development version
- 188.8.131.52 (20 October 2017)
- Central Repository
The CLHEP website provides some documentation on building and installing standalone
CLHEP libraries at http://proj-clhep.web.cern.ch/proj-clhep/INSTALLATION/clhep-2.0.html .
According to the release notes, http://geant4.web.cern.ch/geant4/support/ReleaseNotes4.10.2.html, the supported version of CLHEP for
Geant4.10.2.p01 is 184.108.40.206. Using other versions of
CLHEP may produce incorrect simulation results.
When downloading software, the downloaded tarball (or other
Zip archive) should be placed in an appropriately named directory in
/unix/pbt/software/src: the instructions below assume that the directory is
/unix/pbt/software/src/clhep. The tarball should then be extracted into the same subdirectory.
For CLHEP, the tarball is named
clhep-220.127.116.11.tgz. When extracted, this produces a directory called
18.104.22.168. Therefore, you will end up with a directory called
/unix/pbt/software/src/clhep/22.214.171.124 containing the CLHEP source code.
Installation from Central Repository
Once the latest version of CLHEP has been pulled from its central repository and placed within
/unix/pbt/software/src/clhep/, create a build directory within the PBT Software directory from which you can compile
cd /unix/pbt/software/build/ mkdir clhep-126.96.36.199 cd clhep-188.8.131.52
CMake can then be used to compile
cmake ../../src/clhep/ ccmake .
ccmake . opens an interactive GUI that can be used to specify installation options. From within this you can define your installation directory and configure any other options as required. On the PBT cluster it is required that the software is installed to the development directory, and so the
CMAKE_INSTALL_PREFIX is defined as follows:
- c to configure
- g to generate and exit
The software can then be installed using the usual commands:
make make install
Installation from the Source Code
Source Code Extraction
cd /unix/pbt/software/src/clhep tar -xvzf clhep-184.108.40.206.tgz
Build And Install
cd /unix/pbt/software/build mkdir -pv clhep/clhep-220.127.116.11 cd clhep/clhep-18.104.22.168 cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/clhep-22.214.171.124 /unix/pbt/software/src/geant4-prerequisites/clhep/126.96.36.199/CLHEP make make install
It may be possible to install in the production environment by running cmake again and changing the install prefix, then running make install:
cd /unix/pbt/software/build/clhep/clhep-188.8.131.52 cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/prod . make install
This will save having to compile the code again. If this does not work, the compilation steps for the development environment (above) will need to be repeated in another build directory:
cd /unix/pbt/software/build mkdir -pv clhep/clhep-184.108.40.206-prod cd clhep/clhep-220.127.116.11-prod cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/prod /unix/pbt/software/src/clhep/18.104.22.168/CLHEP make make install