Software/Geant4/Installation/CLHEP: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 15: Line 15:
; Website : http://proj-clhep.web.cern.ch/proj-clhep/
; Website : http://proj-clhep.web.cern.ch/proj-clhep/
; Source URL : http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/
; Source URL : http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/
; Installed version : 2.3.1.1 (15 Mar 2016)
; Installed Production version : 2.3.1.1 (15 Mar 2016)
; Source code : <code>src/geant4-prerequisites/clhep/2.3.1.1</code>
; Source code : <code>src/geant4-prerequisites/clhep/2.3.1.1</code>
; Installed Development version : 2.3.4.5 (20 October 2017)
; Central Repository : https://gitlab.cern.ch/CLHEP/CLHEP


== Installation Notes ==
== Installation Notes ==
Line 24: Line 26:
According to the release notes, http://geant4.web.cern.ch/geant4/support/ReleaseNotes4.10.2.html, the supported version of CLHEP for <code>Geant4.10.2.p01</code> is 2.3.1.1. Using other versions of <code>CLHEP</code> may produce incorrect simulation results.
According to the release notes, http://geant4.web.cern.ch/geant4/support/ReleaseNotes4.10.2.html, the supported version of CLHEP for <code>Geant4.10.2.p01</code> is 2.3.1.1. Using other versions of <code>CLHEP</code> may produce incorrect simulation results.


For installation, <code>CLHEP</code> does not support installation into a sandbox directory (i.e. there are no options <code>prefix</code> or <code>DESTDIR</code> defined for command <code>make install</code>) and must be given the installation directory with the <code>-prefix</code> option.
== Installation ==
As such, to recompile <code>CLHEP</code> for different target directories, the <code>configure</code> script must be rerun with a modified <code>-prefix /path/to/dest</code> option.  This has to be managed manually as can be seen in the installation commands below.
 
When downloading software, the downloaded tarball (or other <code>Zip</code> archive) should be placed in an appropriately named directory in <code>/unix/pbt/software/src</code>: the instructions below assume that the directory is <code>/unix/pbt/software/src/clhep</code>. The tarball should then be extracted into the same subdirectory.
 
For CLHEP, the tarball is named <code>clhep-2.3.1.1.tgz</code>. When extracted, this produces a directory called <code>2.3.1.1</code>. Therefore, you will end up with a directory called <code>/unix/pbt/software/src/clhep/2.3.1.1</code> containing the CLHEP source code.
 
=== Installation from Central Repository ===
 
Once the latest version of CLHEP has been pulled from its [https://gitlab.cern.ch/CLHEP/CLHEP central repository] and placed within <code>/unix/pbt/software/src/clhep/</code>, create a build directory within the PBT Software directory from which you can compile <code>CLHEP</code>:
 
<pre>
cd /unix/pbt/software/build/
mkdir clhep-2.3.4.5
cd clhep-2.3.4.5
</pre>
 
<code>CMake</code> can then be used to compile <code>CLHEP</code>:


== Installation ==
<pre>
cmake ../../src/clhep/
ccmake .
</pre>
 
The command <code>ccmake .</code> 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 <code>CMAKE_INSTALL_PREFIX</code> is defined as follows:


When downloading software, the downloaded tarball (or other <code>Zip</code> archive) should be placed in an appropriately named directory in <code>/unix/pbt/software/src</code>: the instructions below assume that the directory is <code>/unix/pbt/software/src/clhep</code>.
<pre>
CMAKE_INSTALL_PREFIX        /unix/pbt/software/dev/clhep-2.3.4.5/
</pre>


The source code should then be extracted into a suitable subdirectory in <code>/unix/pbt/software/build</code>.  The extracted source code directory can only be deleted once the software has been built and installed.
* ''c'' to configure
* ''g'' to generate and exit


=== Source Code Extraction ===
The software can then be installed using the usual commands:


<pre>
<pre>
cd /unix/pbt/software/src/geant4-prerequisites/qt
make
tar -xvz -f qtbase-opensource-src-5.6.0.tar.gz
make install
mv qtbase-opensource-src-5.6.0 qt-5.6.0
</pre>
</pre>


=== Build And Install ===
=== Installation from the Source Code ===
 
==== Source Code Extraction ====
 
<pre>
cd /unix/pbt/software/src/clhep
tar -xvzf clhep-2.3.1.1.tgz
</pre>


These instructions assume the code has already been built for the '''Development''' environment before building for the '''Production''' environment, so some of the commands for the '''Production''' install are omitted. 
==== Build And Install ====
Although it is highly discouraged to install straight to the '''Production''' environment without first compiling a '''Development''' version, it is possible to do so by adding in the directory creation commands at the start.


==== Development Environment ====
===== Development Environment =====


<pre>
<pre>
cd /unix/pbt/software/build
cd /unix/pbt/software/build
mkdir -pv qt/qt-5.6.0
mkdir -pv clhep/clhep-2.3.1.1
cd qt/qt-5.6.0
cd clhep/clhep-2.3.1.1
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/dev/qt-5.6.0 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/clhep-2.3.1.1 /unix/pbt/software/src/geant4-prerequisites/clhep/2.3.1.1/CLHEP
make
make
make install
make install
</pre>
</pre>


==== Production Environment ====
===== Production Environment =====
 
It may be possible to install in the production environment by running cmake again and changing the install prefix, then running make install:


<pre>
<pre>
cd /unix/pbt/software/build/qt/qt-5.6.0
cd /unix/pbt/software/build/clhep/clhep-2.3.1.1
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/prod-sl6 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/prod .
make install
</pre>
 
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:
 
<pre>
cd /unix/pbt/software/build
mkdir -pv clhep/clhep-2.3.1.1-prod
cd clhep/clhep-2.3.1.1-prod
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/prod /unix/pbt/software/src/clhep/2.3.1.1/CLHEP
make
make
make install
make install
</pre>
</pre>

Latest revision as of 09:56, 20 October 2017

Introduction

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. By default 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 Geant4. As such, the instructions below relate to the standalone version of CLHEP.

Details

Website
http://proj-clhep.web.cern.ch/proj-clhep/
Source URL
http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/
Installed Production version
2.3.1.1 (15 Mar 2016)
Source code
src/geant4-prerequisites/clhep/2.3.1.1
Installed Development version
2.3.4.5 (20 October 2017)
Central Repository
https://gitlab.cern.ch/CLHEP/CLHEP

Installation Notes

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 2.3.1.1. Using other versions of CLHEP may produce incorrect simulation results.

Installation

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-2.3.1.1.tgz. When extracted, this produces a directory called 2.3.1.1. Therefore, you will end up with a directory called /unix/pbt/software/src/clhep/2.3.1.1 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 CLHEP:

cd /unix/pbt/software/build/
mkdir clhep-2.3.4.5
cd clhep-2.3.4.5

CMake can then be used to compile CLHEP:

cmake ../../src/clhep/
ccmake .

The command 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:

CMAKE_INSTALL_PREFIX         /unix/pbt/software/dev/clhep-2.3.4.5/
  • 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-2.3.1.1.tgz

Build And Install

Development Environment
cd /unix/pbt/software/build
mkdir -pv clhep/clhep-2.3.1.1
cd clhep/clhep-2.3.1.1
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/clhep-2.3.1.1 /unix/pbt/software/src/geant4-prerequisites/clhep/2.3.1.1/CLHEP
make
make install
Production Environment

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-2.3.1.1
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-2.3.1.1-prod
cd clhep/clhep-2.3.1.1-prod
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/prod /unix/pbt/software/src/clhep/2.3.1.1/CLHEP
make
make install