Categories
Uncategorized

GEANT4 on Ubuntu 22.04

Geant4 on Ubuntu 22.04 build instructions for the discerning radiation transport modeller.

The reference instructions for Geant4 can be found here. First, make a directory called geant4 somewhere sensible, and change into it.

mkdir geant4
cd geant4

Next, clone the ROOT git repository using:

git clone https://github.com/Geant4/geant4.git geant4-git

Now, inside the genat4-git directory, checkout a particular version:

git checkout v11.0.3

And then make build and install directories:

mkdir geant4-v11.0.3-build
mkdir genat4-v11.0.3-install

And then build…

cd geant4-v11.0.3-build
cmake -DCMAKE_INSTALL_PREFIX=../geant4-v11.0.3-install -DGEANT4_INSTALL_DATA=ON ../geant4-git
make -j 4
make install

Next add the following to the .bashrc file:

source /path/to/geant4/geant4-v11.0.3-install/bin/geant4.sh

Did I magically have some prerequisites installed? Probably! Does this post merit the sad face at the top? Probably not! I will endeavour to update as required.

Leave a Reply