Installation


GEANT4

Installation

CMake options

In order to successfuly build eAST it is mandatory that you set the options listed below when using cmake to build Geant4. As you can see from the table, if you start from scratch you may need to install the prerequisits first such as X11, Qt5, OpenGL and Xerces-C++ libraries. Please see the Appendix for comments and some practical advice about how to proceed.

Option Comment
GEANT4_USE_GDML Requires Xerces-C++ parser.
GEANT4_USE_OPENGL_X11 Requires X11 and OpenGL libraries.
GEANT4_USE_QT Requires Qt5 and OpenGL libraries.
GEANT4_INSTALL_DATA Installs datasets.

A command line for cmake using these options might look like this:

cmake -DCMAKE_INSTALL_PREFIX=/install/path -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_QT=ON /path/to/geant/directory

In certain cases (not very common) the user may need to build a version of Geant4 where multithreading is disabled. One such cases is creation of Python bindings on certain platforms. In such cases, the following option will need to be added:

-DGEANT4_BUILD_MULTITHREADED=OFF

Setting up eAST

Build and Install

The following is a working example of commands for the build and install procedure (assuming they are run from the eAST directory):

cmake -DCMAKE_INSTALL_PREFIX=/path/to/installdir -DHepMC3=~/path/to/HepMC3dir/ -S . -B build
cmake --build build
cmake --install build

The last command will copy libraries, binaries, data, and cmake configuration files into the predefined install location. If you elect to install into a system directory (e.g. under /opt etc) please see the notes in the Geant4 section above, regarding correct permissions. After installation has completed you probably want to ensure that (in this example) /path/to/installdir/bin is in the $PATH environment variable and /path/to/installdir/lib in $LD_LIBRARY_PATH.

HepMC3

Many use cases involve using the HepMC3 libraries so it is effectively a prerequisite for eAST. This is also implied in the build option illustrated in the previous section (cf. -DHepMC3). Please visit the HepMC3 page if you need to install HepMC3 from binaries or build it from source. When downloading the tar file as per instructions, it is possible that the link is stale, so the version number will need to be adjusted to point to an existing file.

Final steps

Once the HepMC3 installation is complete (or is already in place), in order for eAST to work, the environment variable LD_LIBRARY_PATH will need to be updated to include the path the the HepMC3 libraries. This can be done after sourcing the Geant4 post-installation script.


Appendix

GEANT4 dependencies

Xerces

The Xerces build and intallation webpage mentions cmake – although the latter is not explicitly invoked, and you only need to run configure and make. Read the web page carefully.

Qt

The Qt installation procedure has evolved over the years. Using the GUI installer provided by the developer appears to frequently cause problems. At the time of writing, this procedure is working:

# prerequisites:
sudo apt-get -y install build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5
# qt:
sudo apt-get install qtbase5-dev
sudo apt-get install qtdeclarative5-dev

libxmu

sudo apt-get install -y libxmu-dev

Passing options to “make”

On many Linux platforms, cmake is relying on make for the build step. It is possible in these cases to pass helpful options (such as use multiple cores for compilation) to make by setting an environment variable:

export MAKEFLAGS=-j4

Running Geant4 graphics under WSL2

In some cases an extra step is needed to get the graphics driver to work correctly, for example in WSL2 the following setting is helpful:

export LIBGL_ALWAYS_INDIRECT=