Installation Guide

There are several ways to install Geant4 on your computer either from binary packages or by compiling from scratch, and these are described below. Which one is available or best for you depends on both your operating system and usage requirements. In all cases, always use the most recent Geant4 release to ensure use of the latest bug fixes, features, and help the developers and community to provide quick user support.

Build and Install Geant4 from Source

Geant4 uses CMake to configure a build system for compiling and installing the toolkit headers, libraries and support tools from scratch. To follow this method, please see Geant4 System/Software Prerequisites for the operating system and software requirements, followed by Building and Installing from Source.

Whilst every effort has been made to make this installation method robust and reliable, the multitude of platforms and system configurations mean we cannot guarantee that problems will not be encountered on platforms other than those listed in Supported and Tested Platforms.

In case of issues with building and installing Geant4, we welcome questions as well as feedback via our Discourse Forum. To help us deal with your problem as quickly as possible, please include as much detail as possible on the problem you have encountered. At minimum, you should let us know the platform and operating system version, C++ compiler vendor (e.g. GNU) and version, CMake version, and any error messages. It also helps to list the sequence of commands you used so we can try and reproduce the issue.

If you feel you have found a genuine bug in the Geant4 CMake build, please report it to the CMake category on our Bugzilla. As with reports to Discourse, please include as much information as possible so that we can triage the bug and track it down quickly. We also welcome general feature requests and feedback on the system through both Discourse and Bugzilla.

Install Geant4 via a Package Manager

Warning

These packages are not maintained by the Geant4 developers, but by helpful members of the community. Please go through each package manager’s standard channels to report any installation issues or to request packaging of the latest release/patch. If you package Geant4 and would like to be added to the list below, please contact us via our Discourse Forum.

Spack on Linux/macOS

Spack ‘s Geant4 package may be installed with

$ spack install geant4

Spack allows different variants of Geant4 to be installed, and to see these run

$ spack info geant4

Homebrew on macOS/Linux

Homebrew no longer provide a formula for Geant4. We are working on a dedicated tap to provide Geant4 formulae and bottles. Please monitor the News category of our Discourse Forum for announcements on this.

Conda on Linux/macOS

A Conda package for Geant4 is available via conda-forge and may be installed into an environment via

$ conda create -c conda-forge --name <my-environment> geant4
$ conda activate <my-environment>

Please see the associated feedstock for further information and support.

Macports

MacPorts supplies a port for Geant4 which may be installed with

$ sudo port install geant4

Arch Users Repository on Arch Linux

The Arch Users Repository contains a package for Geant4. You are free to use any of the available AUR helpers to compile and install it but you can also do it yourself as follows

$ git clone https://aur.archlinux.org/geant4.git
$ cd geant4
$ makepkg --syncdeps

at that point you have a created a package file called geant4-<version>-x86_64.pkg.tar which you can install using pacman -U either as root or using sudo if your system is configured for it.

You are welcome to review the flags used for compilation in the PKGBUILD file inside the geant4 folder. See Building and Installing from Source for details.

Linux System Package Managers

Several Linux distributions provide Geant4 through their system package managers, either directly or through community repositories. A partial list with links to details are available from Repology at:

  • Packages named geant4

  • Packages named geant (but please note that the ‘4’ in ‘Geant4’ is not part of the version!)

LCG CVMFS Releases for CentOS7/8/9 and Ubuntu Linux, macOS

If your platform can use or has CVMFS installed, Geant4 is available through the LCG Releases from the sft.cern.ch repository for CentOS7. Ubuntu 18.04/20.04 and macOS packages are available in a handful of releases.

Status of this Document

Guide for the installation and configuration of the Geant4 toolkit.

  • Rev 1.0: First sphinx version implemented for Geant4 Release 10.4, 8th Dec 2017

  • Rev 2.0: Updates and fixes in documentatio for Geant4 Release 10.4, 15th May 2018

  • Rev 3.0: Geant4 Release 10.5, 11th December 2018

  • Rev 3.1: Geant4 Updates and fixes - especially to search functionality, 5th March 2019

  • Rev 4.0: Geant4 Release 10.6, 6th December 2019

  • Rev 5.0: Geant4 Release 10.7, 4th December 2020

  • Rev 6.0: Geant4 Release 11.0, 10th December 2021

  • Rev 7.0: Geant4 Release 11.1, 9th December 2022

  • Rev 7.1: Geant4 Fixes to http links, 15th July 2023

  • Rev 8.0: Geant4 Release 11.2, 8th December 2023