Installation tutorial of GEANT4 under Ubuntu


Installation tutorial of GEANT4 under Ubuntu

GEANT4 is a particle transport simulation software developed by CERN. It uses Monte Carlo algorithm. Its specialty fields are high-energy physics and nuclear physics, such as photon neutron radiation shielding simulation, particle detector performance research, accelerator simulation, etc. it is used in physics, medicine, biology and other fields. The software is developed in C / C + +, follows the open source protocol, has a high degree of freedom and is free of charge. However, the threshold of GEANT4 programming development is high, and there are certain requirements for C / C + + ability.
I installed GEANT4 under Ubuntu (16.04) system. The installation process is recorded here for reference.

1 install dependent Libraries

The dependency libraries of GEANT4 vary according to the basic functions and optional functions (such as visualization) of GEANT4.

1.1 library required for GEANT4 basic functions

First, introduce the libraries required to install basic functions. For the official introduction of dependent libraries, see(…), use the Ubuntu library installer apt.
sudo apt-get install build-essential
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libxt-dev

To install XMU related libraries, first use apt cache search to search with “XMU” as the keyword:
apt-cache search libxmu
Then install selectively according to the listed items, or install all, for example:
sudo apt-get install libxmuu-de

Install expat related libraries (the same as XMU library installation, retrieve first and then install):
apt-cache search expat

1.2 library required for GEANT4 visualization function

There are many libraries required for visualization functions, including QT, OpenGL and so on. The official instructions can be referred to(…), of which
These are the options for visualization.
OpenGL and raytracer are used here (of course, you can try QT because QT is easier to use).
apt-cache search xerces
sudo apt-get install libxerces-c-dev
sudo apt-get install libxerces-c-doc
sudo apt-get install libxerces-c-samples
sudo apt-get install libxerces-c3.1
The X11 library is already installed in the basic library (libxt DEV)

2 GEANT4 installation

Here, please refer to the official installation process of GEANT4(…)。 You can also refer to my previous blog “Introduction to GEANT4 installation”(… )。