| ... | ... | @@ -2,17 +2,18 @@ |
|
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
In this tutorial we will use Geant4 version 11.3.2, compiled with the support of multithreading, GDML and Qt5 based Gui.
|
|
|
|
In this tutorial we will use Geant4 version 11.4.0, compiled with the support of multithreading, GDML and Qt5 based Gui.
|
|
|
|
|
|
|
|
The repository scripts was updated for Geant4 version 11.3.2,
|
|
|
|
but if you have version 11.3.1 it will work also.
|
|
|
|
The repository scripts was updated for Geant4 version 11.4.0,
|
|
|
|
if you have version 11.3.2 it will work also, but GUI can look
|
|
|
|
differently and defaul visual driver changed to TGS in 11.4.0
|
|
|
|
|
|
|
|
On Linux systems we use a compiled version of Geant4 and a binary distribution for ROOT installations.
|
|
|
|
|
|
|
|
Below we provide detailed instructions for the installation on Ubuntu 22.04.
|
|
|
|
Below we provide detailed instructions for the installation on Ubuntu 24.04.
|
|
|
|
The installation for other Debian and Ubuntu like Linux'es will be similar but the names of libraries can be slightly different. On Linux you can use GNU *c++*, *clang* or Intel *icc* compilers, we describe only the GNU *g++* installation.
|
|
|
|
|
|
|
|
The installation was tested Windows 11 WLS2 *Ubuntu* application and gcc 13.3.
|
|
|
|
The installation also tested Windows 11 WLS2 *Ubuntu* application and gcc 13.3.
|
|
|
|
|
|
|
|
## Ubuntu 24.04 Requirements
|
|
|
|
|
| ... | ... | @@ -69,12 +70,12 @@ The ROOT installation is required for some exercises in this tutorial. |
|
|
|
The tar files with precompiled ROOT binaries for Ubuntu-24.04 can be downloaded from
|
|
|
|
https://root.cern/download/:
|
|
|
|
|
|
|
|
`curl -SLO https://root.cern/download/root_v6.34.08.Linux-ubuntu24.04-x86_64-gcc13.3.tar.gz`
|
|
|
|
`curl -SLO https://root.cern/download/root_v6.36.06.Linux-ubuntu24.04-x86_64-gcc13.3.tar.gz`
|
|
|
|
|
|
|
|
We will install both ROOT and Geant4 into /usr/local directory:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo tar zxf root_v6.34.08.Linux-ubuntu24.04-x86_64-gcc13.3.tar.gz -C /usr/local
|
|
|
|
sudo tar zxf root_v6.36.06.Linux-ubuntu24.04-x86_64-gcc13.3.tar.gz
|
|
|
|
|
|
|
|
sudo chown -R `id -un`:`id -gn` /usr/local/root
|
|
|
|
chmod +x /usr/local/root/bin/thisroot.*
|
| ... | ... | @@ -131,13 +132,13 @@ In the Terminal window type the commands: |
|
|
|
```
|
|
|
|
git clone https://gitlab.cern.ch/geant4/geant4.git
|
|
|
|
cd geant4/
|
|
|
|
git checkout v11.3.2
|
|
|
|
This will create a clone of the Geant4 11.3.2 release on your local disk.
|
|
|
|
git checkout v11.4.0
|
|
|
|
This will create a clone of the Geant4 11.4.0 release on your local disk.
|
|
|
|
|
|
|
|
The ROOT and Geant4 are installed with the current user as owner.
|
|
|
|
You need to create a target directory owned by my current user:
|
|
|
|
|
|
|
|
`sudo mkdir -p /usr/local/geant4/11.3.2`
|
|
|
|
`sudo mkdir -p /usr/local/geant4/11.4.0`
|
|
|
|
|
|
|
|
`sudo chown -R `id -un`:`id -gn` /usr/local/geant4`
|
|
|
|
```
|
| ... | ... | @@ -147,9 +148,10 @@ Make build configuration files with cmake: |
|
|
|
```
|
|
|
|
mkdir geant4-build
|
|
|
|
cd geant4-build
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4/11.3.2 \
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4/11.4.0 \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo [ -DGEANT4_BUILD_MULTITHREADED=ON ] \
|
|
|
|
-DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_QT=ON \
|
|
|
|
-DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON \
|
|
|
|
-DGEANT4_USE_QT=ON -DGEANT4_USE_QT=ON \
|
|
|
|
-DGEANT4_USE_OPENGL_X11=ON [-DGEANT4_USE_FREETYPE=ON] ../geant4
|
|
|
|
```
|
|
|
|
|
| ... | ... | @@ -161,7 +163,7 @@ Now you can comile binaries and install Geant4: |
|
|
|
cmake --build . --target install -- -j8
|
|
|
|
```
|
|
|
|
|
|
|
|
Geant4 is now installed in the `/usr/local/geant4/11.3.2` directory.
|
|
|
|
Geant4 is now installed in the `/usr/local/geant4/11.4.0` directory.
|
|
|
|
|
|
|
|
The installation script `build-geant4-ubuntu.sh` will do all these steps.
|
|
|
|
|
| ... | ... | @@ -179,8 +181,8 @@ if [ -x /usr/local/root/bin/thisroot.sh ]; then |
|
|
|
fi
|
|
|
|
|
|
|
|
# Geant4
|
|
|
|
if [ -x /usr/local/geant4/11.3.2/bin/geant4.sh ]; then
|
|
|
|
. /usr/local/geant4/11.3.2/bin/geant4.sh
|
|
|
|
if [ -x /usr/local/geant4/11.4.0/bin/geant4.sh ]; then
|
|
|
|
. /usr/local/geant4/11.4.0/bin/geant4.sh
|
|
|
|
fi
|
|
|
|
```
|
|
|
|
|
| ... | ... | @@ -201,7 +203,7 @@ Start the ROOT interactive session: |
|
|
|
```
|
|
|
|
$ root
|
|
|
|
------------------------------------------------------------------
|
|
|
|
| Welcome to ROOT 6.34.08 https://root.cern |
|
|
|
|
| Welcome to ROOT 6.34.08 https://root.cern |
|
|
|
|
| (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
|
|
|
|
| Built for linuxx8664gcc on Apr 07 2025, 20:24:19 |
|
|
|
|
| From tags/v6-34-08@v6-34-08 |
|
| ... | ... | @@ -236,7 +238,7 @@ E.g. basic B1 example. |
|
|
|
$ cd ~/tmp
|
|
|
|
$ mkdir B1-build
|
|
|
|
$ cd B1-build
|
|
|
|
$ cmake /usr/local/geant4/11.3.2/share/Geant4/examples/basic/B1
|
|
|
|
$ cmake /usr/local/geant4/11.4.0/share/Geant4/examples/basic/B1
|
|
|
|
```
|
|
|
|
|
|
|
|
You should see something like the output below. Watch for eventual configuration errors.
|
| ... | ... | @@ -253,14 +255,14 @@ You should see something like the output below. Watch for eventual configuratio |
|
|
|
-- Check for working CXX compiler: /usr/bin/c++ - skipped
|
|
|
|
-- Detecting CXX compile features
|
|
|
|
-- Detecting CXX compile features - done
|
|
|
|
-- Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found suitable version "2.6.1", minimum required is "2.6.1")
|
|
|
|
-- Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found suitable version "2.6.1", minimum required is "2.6.1")
|
|
|
|
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
|
|
|
|
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
|
|
|
|
-- Found Threads: TRUE
|
|
|
|
-- Found XercesC: /usr/lib/x86_64-linux-gnu/libxerces-c.so (found suitable version "3.2.4", minimum required is "3.2.4")
|
|
|
|
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found suitable version "2.13.2", minimum required is "2.13.2")
|
|
|
|
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
|
|
|
|
-- Found X11: /usr/include
|
|
|
|
-- Found Threads: TRUE
|
|
|
|
-- Found XercesC: /usr/lib/x86_64-linux-gnu/libxerces-c.so (found suitable version "3.2.4", minimum required is "3.2.4")
|
|
|
|
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found suitable version "2.13.2", minimum required is "2.13.2")
|
|
|
|
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
|
|
|
|
-- Found X11: /usr/include
|
|
|
|
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
|
|
|
|
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
|
|
|
|
-- Looking for gethostbyname
|
| ... | ... | @@ -273,8 +275,8 @@ You should see something like the output below. Watch for eventual configuratio |
|
|
|
-- Looking for shmat - found
|
|
|
|
-- Looking for IceConnectionNumber in ICE
|
|
|
|
-- Looking for IceConnectionNumber in ICE - found
|
|
|
|
-- Found Geant4: /usr/local/geant4/11.3.2/lib/cmake/Geant4/Geant4Config.cmake (found version "11.3.2")
|
|
|
|
-- Configuring done (10.5s)
|
|
|
|
-- Found Geant4: /usr/local/geant4/11.4.0/lib/cmake/Geant4/Geant4Config.cmake (found version "11.4.0")
|
|
|
|
-- Configuring done (0.9s)
|
|
|
|
-- Generating done (0.0s)
|
|
|
|
-- Build files have been written to: /home/semenjuk/tmp/B1-build
|
|
|
|
```
|
| ... | ... | @@ -319,7 +321,7 @@ $ ./exampleB1 |
|
|
|
Available UI session types: [ Qt, tcsh, csh ]
|
|
|
|
|
|
|
|
**************************************************************
|
|
|
|
Geant4 version Name: geant4-11-03-patch-01 [MT] (21-March-2025)
|
|
|
|
Geant4 version Name: geant4-11-04 [MT] (5-December-2025)
|
|
|
|
<< in Multi-threaded mode >>
|
|
|
|
Copyright : Geant4 Collaboration
|
|
|
|
References : NIM A 506 (2003), 250-303
|
| ... | ... | |