|
## Geant4 Installation on Ubuntu 20.04 TLS
|
|
## Geant4 Installation on Ubuntu 22.04 TLS
|
|
|
|
|
|
[[_TOC_]]
|
|
[[_TOC_]]
|
|
|
|
|
|
In this tutorial we will use Geant4 version 11.1.1, compiled with the support of multithreading, GDML and Qt5 based Gui.
|
|
In this tutorial we will use Geant4 version 11.2.0, compiled with the support of multithreading, GDML and Qt5 based Gui.
|
|
|
|
|
|
On Linux systems we use a compiled version of Geant4 and a binary distribution for ROOT installations.
|
|
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 20.04.
|
|
Below we provide detailed instructions for the installation on Ubuntu 20.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 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 on VirtualBox VM running *Ubuntu 20.04* and Windows 10 WLS2 *Ubuntu 20.04* application.
|
|
--> The installation was tested on VirtualBox VM running *Ubuntu 20.04* and Windows 10 WLS2 *Ubuntu 20.04* application.
|
|
|
|
|
|
## Ubuntu 20.04 Requirements
|
|
## Ubuntu 22.04 Requirements
|
|
|
|
|
|
* Ubuntu 20.04 LTS Server or Desktop installation
|
|
* Ubuntu 22.04 LTS Server or Desktop installation
|
|
* *build-essential*, *curl*, *g++*, *git* and *cmake* packages
|
|
* *build-essential*, *curl*, *g++*, *git* and *cmake* packages
|
|
* A Bourne-compatible shell for installation (e.g. *bash* or *zsh*)
|
|
* A Bourne-compatible shell for installation (e.g. *bash* or *zsh*)
|
|
* `sudo` for library installation and directory creation under `/usr/local`
|
|
* `sudo` for library installation and directory creation under `/usr/local`
|
... | @@ -26,7 +26,7 @@ Generally we follow the installation rules for ROOT described here: |
... | @@ -26,7 +26,7 @@ Generally we follow the installation rules for ROOT described here: |
|
Some dependancies like kerberos and mysql were dropped because we do not use these features in the tutorial.
|
|
Some dependancies like kerberos and mysql were dropped because we do not use these features in the tutorial.
|
|
The libraries which we need for Geant4 compilation need to be installed first. For this, the `ubuntu20_deps.sh` script is provided on the Ubuntu 20.04 server. This script must be executed only once.
|
|
The libraries which we need for Geant4 compilation need to be installed first. For this, the `ubuntu20_deps.sh` script is provided on the Ubuntu 20.04 server. This script must be executed only once.
|
|
|
|
|
|
See below the code snippet:
|
|
See below the code snippet: TODO
|
|
|
|
|
|
```
|
|
```
|
|
apt install -y qt5-default
|
|
apt install -y qt5-default
|
... | @@ -52,7 +52,7 @@ sudo apt upgrade |
... | @@ -52,7 +52,7 @@ sudo apt upgrade |
|
```
|
|
```
|
|
On Ubuntu 22.04 qt-defaults package not exist use the `ubuntu22_deps.sh` script to install dependancies.
|
|
On Ubuntu 22.04 qt-defaults package not exist use the `ubuntu22_deps.sh` script to install dependancies.
|
|
|
|
|
|
## ROOT Installation
|
|
## ROOT Installation TODO
|
|
|
|
|
|
The ROOT installation is required for some exercises in this tutorial.
|
|
The ROOT installation is required for some exercises in this tutorial.
|
|
|
|
|
... | @@ -94,12 +94,12 @@ Do not forget to install your favorite editor, e.g _Emacs_ : |
... | @@ -94,12 +94,12 @@ Do not forget to install your favorite editor, e.g _Emacs_ : |
|
|
|
|
|
`sudo apt install -y emacs`
|
|
`sudo apt install -y emacs`
|
|
|
|
|
|
You can install the precompiled version of Geant4 provided for this tutorial. You can download the tar file with precompiled Geant4 `geant4_v11.1.1.Linux-ubuntu20-x86_64-gcc9.4.tar.gz` from `cernbox.cern.ch` server. The script `install-geant4-ubuntu20.sh` can be used for downloading and installation of Geant4.
|
|
You can install the precompiled version of Geant4 provided for this tutorial. You can download the tar file with precompiled Geant4 `geant4_v11.2.0.Linux-ubuntu20-x86_64-gcc9.4.tar.gz` from `cernbox.cern.ch` server. The script `install-geant4-ubuntu20.sh` can be used for downloading and installation of Geant4.
|
|
|
|
|
|
The tar file with Geant4 11.1.1 binaries for Ubuntu placed on owncloud server
|
|
The tar file with Geant4 11.2.0 binaries for Ubuntu placed on owncloud server
|
|
https://cernbox.cern.ch/s/gxJhYs7a97CCTAw
|
|
https://cernbox.cern.ch/s/gxJhYs7a97CCTAw
|
|
|
|
|
|
N.B. As the Geant4 setup scripts, geant4.[c]sh and geant4-config, are not relocatable, you need to install Geant4 into `/usr/local/geant4/11.1.1` or to edit these scripts to fix the paths to the data.
|
|
N.B. As the Geant4 setup scripts, geant4.[c]sh and geant4-config, are not relocatable, you need to install Geant4 into `/usr/local/geant4/11.2.0` or to edit these scripts to fix the paths to the data.
|
|
|
|
|
|
If you install the precompiled version you can skip **Build Geant4** section and go directly to **Environment**.
|
|
If you install the precompiled version you can skip **Build Geant4** section and go directly to **Environment**.
|
|
|
|
|
... | @@ -113,20 +113,20 @@ In the Terminal window type the commands: |
... | @@ -113,20 +113,20 @@ In the Terminal window type the commands: |
|
```
|
|
```
|
|
git clone https://gitlab.cern.ch/geant4/geant4.git
|
|
git clone https://gitlab.cern.ch/geant4/geant4.git
|
|
cd geant4/
|
|
cd geant4/
|
|
git checkout v11.1.1
|
|
git checkout v11.2.0
|
|
```
|
|
```
|
|
For Geant4 version 11.1.1 you can also apply pathch 3477.path
|
|
For Geant4 version 11.2.0 you can also apply pathch 3477.path
|
|
which you can found in installg4/install/Ubuntu-20.04/ directory.
|
|
which you can found in installg4/install/Ubuntu-20.04/ directory.
|
|
This path suppress warning abou Qt5 slot/signals.
|
|
This path suppress warning abou Qt5 slot/signals.
|
|
|
|
|
|
`patch -p1 < 3477.patch`
|
|
`patch -p1 < 3477.patch`
|
|
|
|
|
|
This will create a clone of the Geant4 11.1.1 release on your local disk.
|
|
This will create a clone of the Geant4 11.2.0 release on your local disk.
|
|
|
|
|
|
The ROOT and Geant4 are installed with the current user as owner.
|
|
The ROOT and Geant4 are installed with the current user as owner.
|
|
You need to create a target directory owned by my current user:
|
|
You need to create a target directory owned by my current user:
|
|
|
|
|
|
`sudo mkdir -p /usr/local/geant4/11.1.1`
|
|
`sudo mkdir -p /usr/local/geant4/11.2.0`
|
|
|
|
|
|
`sudo chown -R `id -un`:`id -gn` /usr/local/geant4`
|
|
`sudo chown -R `id -un`:`id -gn` /usr/local/geant4`
|
|
|
|
|
... | @@ -134,7 +134,7 @@ Now you can compile and install Geant4: |
... | @@ -134,7 +134,7 @@ Now you can compile and install Geant4: |
|
```
|
|
```
|
|
mkdir geant4-build
|
|
mkdir geant4-build
|
|
cd geant4-build
|
|
cd geant4-build
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4/11.1.1 \
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4/11.2.0 \
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo [ -DGEANT4_BUILD_MULTITHREADED=ON ] \
|
|
-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_OPENGL_X11=ON [-DGEANT4_USE_FREETYPE=ON] ../geant4
|
|
-DGEANT4_USE_OPENGL_X11=ON [-DGEANT4_USE_FREETYPE=ON] ../geant4
|
... | @@ -145,7 +145,7 @@ The multithreading enabled by default and FREETYPE was optional commpnent |
... | @@ -145,7 +145,7 @@ The multithreading enabled by default and FREETYPE was optional commpnent |
|
cmake --build . --target install -- -j4
|
|
cmake --build . --target install -- -j4
|
|
```
|
|
```
|
|
|
|
|
|
Geant4 is now installed in the `/usr/local/geant4/11.1.1` directory.
|
|
Geant4 is now installed in the `/usr/local/geant4/11.2.0` directory.
|
|
|
|
|
|
The installation script `build-geant4-ubuntu20.sh` will do all these steps.
|
|
The installation script `build-geant4-ubuntu20.sh` will do all these steps.
|
|
|
|
|
... | @@ -163,8 +163,8 @@ if [ -x /usr/local/root/bin/thisroot.sh ]; then |
... | @@ -163,8 +163,8 @@ if [ -x /usr/local/root/bin/thisroot.sh ]; then |
|
fi
|
|
fi
|
|
|
|
|
|
# Geant4
|
|
# Geant4
|
|
if [ -x /usr/local/geant4/11.1.1/bin/geant4.sh ]; then
|
|
if [ -x /usr/local/geant4/11.2.0/bin/geant4.sh ]; then
|
|
. /usr/local/geant4/11.1.1/bin/geant4.sh
|
|
. /usr/local/geant4/11.2.0/bin/geant4.sh
|
|
fi
|
|
fi
|
|
```
|
|
```
|
|
|
|
|
... | @@ -187,7 +187,7 @@ E.g. basic B1 example. |
... | @@ -187,7 +187,7 @@ E.g. basic B1 example. |
|
$ cd ~/tmp
|
|
$ cd ~/tmp
|
|
$ mkdir B1-build
|
|
$ mkdir B1-build
|
|
$ cd B1-build
|
|
$ cd B1-build
|
|
$ cmake /usr/local/geant4/11.1.1/share/Geant4-11.1.1/examples/basic/B1
|
|
$ cmake /usr/local/geant4/11.2.0/share/Geant4/examples/basic/B1
|
|
```
|
|
```
|
|
|
|
|
|
You should see something like the output below. Watch for eventual configuration errors.
|
|
You should see something like the output below. Watch for eventual configuration errors.
|
... | | ... | |