Compiling from Source

The following instructions works in bash or zsh shells.

GEMC and the dependency libraries can be compiled using the repository ‘ceInstall’ :

1. Make sure the ALL requirements are satisfied. You may need root priviledges to install certain system packages.

  1. Choose an (existing) installation directory, for example /opt/sim and point SIM_HOME to it. Make sure the directory exists and you have write permissions to it:

    export SIM_HOME=/opt/sim
  2. Clone the latest tag of ceInstall repository inside $SIM_HOME and use its modules:

    cd $SIM_HOME
    git clone
    module use "${SIM_HOME}"/ceInstall/modulefiles
  3. Run the installation script:

    $SIM_HOME/ceInstall/install/install_gemc <version>

<version> can be:

  • 4.4.2: uses geant4 10.6.2 and clas12Tags 4.4.2

  • 5.9: uses geant4 10.6.2 and clas12Tags 5.9

  • 5.10: uses geant4 10.7.4 and clas12Tags 5.10

  • 2.12: uses geant4 10.7.4 and gemc 2.12

GEMC on Docker

GEMC distributed using You can download docker for free here.

Using Docker

Use the following command to open a bash session on the container. You can also replace bash with tcsh:

docker pull jeffersonlab/gemc:2.9
docker run -it --rm jeffersonlab/gemc:2.9 bash

This will open the session in the /jlab/work directory. Use the gemc option USE_GUI=0 to run gemc in batch mode.

Interactive mode (browser)

To use the native geant4 opengl GUI use the following command:

docker run -it --rm  -p127.0.0.1:6080:6080 jeffersonlab/gemc:2.9

Using your web brower open the page:


After clicking connect the linux desktop is shown with a running shell.

You should launch gemc with USE_GUI=2 to optimize the opengl graphic. Try a few examples:

  1. USS enterprise shooting against a dragon:

    cd forFun: gemc fun.gcard -USE_GUI=2 -OUTPUT="txt, out.txt"
  2. Fire protons in the upper gastrointestinal tract:

    cd humanBody: gemc hb.gcard -USE_GUI=2 -OUTPUT="txt, out.txt"


I suggest to set the noVNC settings as follows:

  • Scaling mode: remote

  • Shared mode active (this will ensure if you open another browser session, it will show the same instance of the container)

  • On the docker preferences try to make available as much memory as possible.

You can stop the docker container at any time using ctrl-c in the shell session you started it from.

Interactive mode (vnc)

Use the following command to pass so you can open the container with the browser or a vnc client:

docker run -it --rm -p127.0.0.1:6080:6080 -p 5901:5901 jeffersonlab/gemc:2.9

You can now open localhost:5901 with your vnc client.

Native interactive mode (no opengl)

On a mac, if you allow access from localhost with:

1. Activate the option ‘Allow connections from network clients’ in XQuartz settings
   (Restart XQuartz (to activate the setting)
2. xhost +

Then you can run docker and use the local X server with:

docker run -it --rm -e DISPLAY=docker.for.mac.localhost:0 jeffersonlab/gemc:2.9 bash

You can run gemc in batch mode this way, but still enjoy the ability to open windows on the local host.

Mounting your directories to the container

The container will always start with the “pristine” image. In other words every work the the container filesystem will be lost when you exit docker. You can use the option:

-v /host/directory:/container/directory

to mount your local OS directories to be visible in docker. For example, to mount the “maximilian” home directory in a /max dir in the container:

docker run -it –rm -v /home/maximilian:/jlab/work/max jeffersonlab/gemc:2.9 bash

/jlab/work//max will now point to maximilian home dir. You can save work here.


Other Downloads

Generator: LUND Events sample

10 Deep Inelastic Scattering events in LUND format

GEMC Release Notes

For release notes and the complete changelog see release notes.