Geant4 v11.1.0 installation on a Debian Bullseye (should work on Ubuntu also)

The solution is quite long but copy paste from here should be sufficient (quite easy).

Prerequesite: a fresh conda installation

Description for anaconda installation:

$ bash

It’s also possible to start from an existing working anaconda installation but please make sure that the base environment is updated. Try something like :

$ conda update -n base conda

Note: I tried as specified in the Geant4 Installation guide :

$ conda create -c conda-forge --name my_geant4 geant4
$ conda activate my_geant4

This doesn’t bring a working environment : the first try with basic/B1 compilation produces errors.

The installation presented here was a success on many Debian 11 systems.

So, now that you have a working anaconda let’s go:

$ conda create -n g4_11.1
$ conda activate g4_11.1
$ conda config --add channels conda-forge
$ conda install make cmake compilers sed \
mesa-libgl-devel-cos7-x86_64 mesa-dri-drivers-cos7-x86_64 \
libselinux-cos7-x86_64 libxdamage-cos7-x86_64 \
libxxf86vm-cos7-x86_64 libxext-cos7-x86_64 \
python boost=1.80.0 \
clhep= expat freetype \
libglu qt=5.15 xerces-c \
zlib tbb \
xorg-libx11 xorg-libxfixes xorg-libxmu xorg-libxfixes

It will take time and you have to answer “y” to proceed… Then ensure that you have a devel/Geant4 directory in your Home directory and…

$ cd $HOME/devel/Geant4

bring the tar.gz geant4 archive here (in ‘$HOME/devel/Geant4’) and proceed with:

$ tar xvfz geant4-v11.1.0.tar.gz
$ mkdir build_g4_11.1
$ cd build_g4_11.1
$ export GEANT4_INSTALL=$HOME/anaconda3/envs/g4_11.1
$ cmake $HOME/devel/Geant4/geant4-v11.1.0 \
-DGEANT4_BUILD_TLS_MODEL=global-dynamic \

$ make -j 12

These will take very long time and can be repeated, specially if there was errors (normally they should not have errors but memory can stop some compilation and the repeat will just finish the work.


$ make install

It’s done!!!

Just in case that you want to compile a provided example (like: ‘basic/B1’):

$ conda activate g4_11.1
$ source
$ cd $HOME/devel/Geant4/geant4-v11.1.0/examples/basic
$ make B1_build
$ cd B1_build
$ cmake …/B1
$ make -j 12
$ ./exampleB1

That’s easy!
Hope this helps you, I had to search and take advantage of this post to build this solution for the new geant4-v11.1.0.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.