License
See the license conditions.
Release Notes
Note
Use the most recent GEMC release to ensure you are taking advantage of latest bug fixes and the new features. This also helps the developers to provide the best support.
Table of Contents
Build and Install GEMC from Source
Please see the GEMC/Geant4 Software Prerequisites in the appendix for the requirements.
Obtaining the source
For illustration only, we will use /path/to/gemc
as the installation location, and 1.0
as the version to be installed.
Create a source
sub-dir in the installation location and cd into it:
mkdir -p /path/to/gemc/1.0/source
cd /path/to/gemc/1.0/source
There are two approaches:
Download the latest release:
cd /path/to/gemc/1.0/source
wget https://github.com/gemc/src/releases/tag/1.0.tar.gz
tar -xvzf 1.0.tar.gz --strip-components=1
At your own risk, clone the repository to get the development version. The directory must be empty.
git clone --depth=1 https://github.com/gemc/src .
Compile and install GEMC
The meson build system is used to compile and install GEMC.
A build
directory is used:
meson setup build --native-file=core.ini --prefix=/path/to/gemc/1.0
meson compile -C build
meson install -C build
- The setup phase will check for the required dependencies and fetch external libraries.
- The compile phase will build the code using all your available CPU cores. Use
-jN
to limit the number of cores used. - The install phase will copy the binaries, libraries, and python modules to the installation directory.
Build Options
- Use
-v
at build time to log the compiler commands meson test -v
will run several tests of various components of GEMC and also create a database with the examples geometries.- To wipe out the build directory and start over, use
rm -rf build
and then re-run the commands above.
Post Installation
Add the bin
and api
directories to your PATH
and PYTHONPATH
environment variables.
export GEM_VERSION=1.0
export PATH=/path/to/gemc/$GEM_VERSION/bin:$PATH
export PYTHONPATH=/path/to/gemc/$GEM_VERSION/api:$PYTHONPATH
You can add the lines above to your shell configuration file (e.g. ~/.bashrc
or ~/.zshrc
), and use
$GEMC_VERSION
to control the version of GEMC you want to use.
Run GEMC in a Docker Container
You can use docker to run GEMC without having to install it or any of its dependencies. The available GEMC docker images are listed below.
Image | Pull Command | VNC Access |
---|---|---|
Ubuntu 24.04 | docker pull ghcr.io/gemc/gemc:latest-ubuntu24 |
true |
AlmaLinux 9.4 | docker pull ghcr.io/gemc/gemc:latest-almalinux94 |
false |
Fedora 40 | docker pull ghcr.io/gemc/gemc:latest-fedora40 |
true |
It is recommended to bind a local directory to save and store your work.
For illustration purposes, below we will bind the image path /mywork
to the local dir ~/mywork
and we will use the image ghcr.io/gemc/gemc:latest-ubuntu24
.
For Apple Silicon Mac you may need to add the option --platform linux/amd64
to the docker commands below.
Run docker in batch mode
docker run -it --rm -v ~/mywork:/mywork ghcr.io/gemc/gemc:latest-ubuntu24 bash
Run docker and use a browser for the graphical interface:
docker run -it --rm -v ~/mywork:/mywork -p 8080:8080 ghcr.io/gemc/gemc:latest-ubuntu24
Then point your browser to http://localhost:8080/vnc.html
to access the graphical interface.
Appendix
GEMC and Geant4 Software Prerequisites
-
Builders and compilers:
-
Packages, compiled from source against the same C++ Standard as GEMC (C++17 by default):
-
Packages installed with your system package manager:
One liners installation of basic packages and dependencies on some popular Linux distributions:
dnf install -y --allowerasing git make cmake gcc-c++ gdb valgrind expat-devel mariadb-devel \
sqlite-devel python3-devel ninja-build mesa-libGLU-devel libX11-devel libXpm-devel libXft-devel \
libXt-devel libXmu-devel libXrender-devel xorg-x11-server-Xvfb xrandr bzip2 wget curl nano bash \
zsh hostname gedit environment-modules pv which psmisc procps mailcap net-tools rsync patch \
bash-completion xterm x11vnc openbox lxqt-panel dejavu-sans-mono-fonts qt6-qtbase-devel root liblsan \
libasan libubsan libtsan tbb
dnf install -y --allowerasing git make cmake gcc-c++ gdb valgrind expat-devel mariadb-devel \
sqlite-devel python3-devel ninja-build mesa-libGLU-devel libX11-devel libXpm-devel libXft-devel \
libXt-devel libXmu-devel libXrender-devel xorg-x11-server-Xvfb xrandr bzip2 wget curl nano bash
zsh hostname gedit environment-modules pv which psmisc procps mailcap net-tools rsync patch \
bash-completion xterm x11vnc openbox tint2 dejavu-sans-mono-fonts qt6-qtbase-devel root liblsan \
libasan libubsan libtsan tbb
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata git make cmake \
g++ gdb valgrind libexpat1-dev libmysqlclient-dev libsqlite3-dev python3-dev ninja-build \
libglu1-mesa-dev libx11-dev libxpm-dev libxft-dev libxt-dev libxmu-dev libxrender-dev \
xvfb x11-xserver-utils bzip2 wget curl nano bash zsh hostname gedit environment-modules pv \
which ca-certificates psmisc procps mailcap net-tools rsync patch bash-completion xterm \
x11vnc openbox tint2 dbus-x11 fonts-dejavu-core qt6-base-dev libqt6opengl6t64 \
libqt6openglwidgets6t64 qt6-base-dev-tools liblsan0 libasan8 libubsan1 libtsan2 libtbb12
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata git make cmake \
g++ gdb valgrind libexpat1-dev libmariadb-dev libsqlite3-dev python3-dev ninja-build \
libglu1-mesa-dev libx11-dev libxpm-dev libxft-dev libxt-dev libxmu-dev libxrender-dev \
xvfb x11-xserver-utils bzip2 wget curl nano bash zsh hostname gedit environment-modules pv \
which ca-certificates psmisc procps mailcap net-tools rsync patch bash-completion xterm \
x11vnc openbox tint2 dbus-x11 fonts-dejavu-core qt6-base-dev libqt6opengl6 libqt6openglwidgets6 \
qt6-base-dev-tools liblsan0 libasan8 libubsan1 libtsan2 libtbb12
pacman-key --init && pacman-key --populate
pacman -Sy --noconfirm archlinux-keyring
pacman -Syu --noconfirm --needed git make cmake gcc gdb valgrind expat mariadb mariadb-libs \
sqlite python python-pip ninja mesa glu libx11 libxpm libxft libxt libxmu libxrender \
xorg-server-xvfb xorg-xrandr bzip2 wget curl nano bash zsh inetutils gedit pv which fakeroot \
psmisc procps mailcap net-tools rsync patch bash-completion ncurses xterm tigervnc openbox \
ttf-dejavu qt6-base root gcc-libs tbb
Supported and tested platforms
-
Linux:
- Fedora 40 or later
- AlmaLinux 9 or later
- Ubuntu 24.04 or later
- Debian 12 or later
- Arch Linux (rolling release)
- macOS: 15 or later (Sequoia)