Difference between revisions of "HOWTO install and run HDGeant4"

From GlueXWiki
Jump to: navigation, search
(External library dependencies)
(External library dependencies)
Line 32: Line 32:
  
 
==External library dependencies==
 
==External library dependencies==
# '''sim-recon''' - The core components of the GlueX software stack are distributed in a single unified bundle called "sim-recon". This package has a number of external packages upon which it depends. Users who want to build and use HDGeant4 should already be familiar with sim-recon. Installation instructions for sim-recon can be found here.
+
# '''sim-recon''' - The core components of the GlueX software stack are distributed in a single unified bundle called "sim-recon". This package has a number of external packages upon which it depends. Users who want to build and use HDGeant4 should already be familiar with sim-recon. Installation instructions for sim-recon can be found on the page [[https://halldweb.jlab.org/wiki/index.php/Getting_started_with_GlueX_Software]].
 
# '''geant4''' -
 
# '''geant4''' -
 
## '''cmake 3.3''' -
 
## '''cmake 3.3''' -

Revision as of 14:42, 10 October 2016

Download the package sources

The HDGeant4 simulation is still in alpha release. During the present active development phase, it is currently being maintained in a read-only public git repository under the ownership of Richard Jones. The repository is being updated frequently as new features are being added and bugs corrected. Every effort is being made to ensure that the package can be successfully checked out and built after every commit that gets pushed to the master branch on github.

To check out the HDGeant source with the latest updates, go to a work directory where you would like to build the package and type the following command.

$ git clone git@github.com:rjones30/HDGeant4.git
$ cd HDGeant4 && ls
GNUmakefile  INSTALL  README.md  SConstruct  VERSIONS  g4py  src  test  vis

The README file gives an overview of the purpose and function of the HDGeant4 physics simulation package, and gives a bit of history regarding its design and early development. The VERSIONS file contains that release notes and dates for each major release of the HDGeant4 package. The INSTALL file contains the same information as conveyed on this wiki page concerning how to download, build, and run hdgeant4 and associated python modules. The GNUmakefile and SConstruct files contain the instructions for building package executables from source files; see below for further details. The g4py directory contains the python sources that comprise the python modules that are a part of HDGeant4. The src directory contains the C++ sources. The test directory contains a sample control.in file that is useful for initial tests that the hdgeant4 executable functions correctly after it is built. It also contains a suite of eps image files showing various cutaway views of the GlueX detector geometry, which are useful for comparison with the same views that can be generated using hdgeant4 once it is built. The vis directory contains a suite of graphics macros that can be invoked from the interactive command line in hdgeant4 to produce these same cutaway views. These images take a few minutes each to create, but it is worthwhile to take the time to make them because they provide a sensitive test that the GlueX geometry is faithfully represented within the Geant4 release against which you are building hdgeant4.

Supported platforms

The build instructions in this document have been developed for the Linux platform, running a 2.6 kernel. They have only been extensively tested on machines running the Centos 6 distribution, but they should work pretty much without modification on a host running a flavor of Debian, Scientific Linux, Gentoo, Ubuntu, or even Raspian, should anyone want to try such a thing. The code has been compiled and tested with the gnu c++ 4.9.2 compiler/linker suite. It should also work with more recent releases of the gnu compiler, and may even work with version 4.8.2 that is the default release for Centos 7. The only requirement is that it support the commandline option -std=c++11 which enables most of the features included in the C++11 standard.

The default gnu compiler that comes with Centos 6 is gcc-4.4.7 which does not support -std=c++11. Before attempting the instructions below to install an updated compiler version, you can check the currently installed version on your system by typing "gcc -v". If the version reported by this command is older than 4.8 then you will need to upgrade. Version 4.9.2 of the gcc compiler suite can be installed on a Centos 6 machine as a part of the bundle package "devtoolset-3". This package is not available from the standard Centos rpm repositories. I can be found by direct search on the internet, but the simplest means to obtain it is to enable the SCL repositories in your supported yum repositories, and then install devtoolset-3 using yum.

$ yum install centos-release-scl
$ yum install centos-release-scl-rh
$ yum install devtoolset-3

After this completes successfully, all you need to do in order to switch from the base gnu compiler to version 4.9.2 is to type the following from within your working shell,

$ scl enable devtoolset-3 bash

where "bash" can be replaced with the name of your working shell, eg. tcsh or zsh. This command cannot easily be embedded in a script because it results in adding a shell layer to the working environment. To see this, type the command in an interactive shell and then type "ps" to see the additional shell has been introduced. After this, any invocations of the gcc/g++ compilers will bring up the version 4.9.2 compiler (eg. try "g++ -v") until the user types "exit" to return to the original shell; once the exit from the daughter shell completes, the compiler resets automatically back to the default system version.

External library dependencies

  1. sim-recon - The core components of the GlueX software stack are distributed in a single unified bundle called "sim-recon". This package has a number of external packages upon which it depends. Users who want to build and use HDGeant4 should already be familiar with sim-recon. Installation instructions for sim-recon can be found on the page [[1]].
  2. geant4 -
    1. cmake 3.3 -
    2. CLHEP -
    3. xerces 3 -
    4. boost libraries -
    5. Motif and Qt libraries -
    6. X11 with OpenGL extensions -