Geant4 System/Software Prerequisites

OS/Software Prerequisites

The following source/software must be present to either build/install Geant4 or develop applications using it:

  • Geant4 Toolkit Source Code.

  • C++ Compiler and Standard Library supporting the C++11 Standard:

    • Linux: GNU Compiler Collection 4.9.3 or higher.

      • It is strongly recommended to use the GCC compiler supplied by the package management system of your distribution unless this does not meet the minimum version requirement.

    • macOS: Apple Clang (Xcode) 11 or higher.

      • The command line tools must also be installed by running xcode-select --install from the terminal.

    • Windows: Visual Studio 2019, Community version or higher.

    The compiler and standard library need to support at least the following features of the C++11 Standard:

    • Template aliases, as defined in N2258.

    • Automatic type deduction, as defined in N1984.

    • Delegating constructors, as defined in N1986.

    • Enum forward declarations, as defined in N2764.

    • Explicit conversion operators, as defined in N2437.

    • Override control final keyword, as defined in N2928, N3206 and N3272.

    • Lambda functions, as defined in N2927.

    • Null pointer, as defined in N2431.

    • Override control override keyword, as defined in N2928, N3206 and N3272.

    • Range-based for, as defined in N2930.

    • Strongly typed enums, as defined in N2347.

    • Uniform initialisation, as defined in N2640.

  • CMake 3.8 or higher.

    On Linux, we recommend that you use CMake as provided through the package management system of your distribution, unless it does not meet the minimum version requirement. In that case, we recommend you install it using the Linux binary installer for the latest version of CMake, available with instructions from the Kitware download site. This installer is highly portable and should work on the vast majority of distributions.

    On macOS and Windows, CMake is not installed by default, so we recommend that you install it using the most recent Darwin64 dmg (macOS) or Win32 exe (Windows) installers supplied by the Kitware download site. On macOS, you may also use the Homebrew or Macports package managers to install the required version.

    For more information on CMake, the CMake Help and Documentation should be consulted.

Supported and Tested Platforms

Geant4 is officially supported on the following operating system and compiler combinations:

  • CentOS 7 Linux with GCC >=4.9.3, >=5.4, >=6.3, >=7.3, >= 8.2, >= 9.2, >= 10.2 64bit

    The minimum required versions of GCC may be installed on CentOS7 systems via the free Developer Toolset packages.

    Geant4 has been successfully compiled on other Linux distributions, including Debian, Ubuntu and openSUSE. The main requirement is that the system has a GCC of sufficient version to support C++11 installed. Please note that distributions other than CentOS are not officially supported. However, feedback and patches for non-CentOS platforms are welcome!

  • macOS 11.0 (Big Sur), 10.15 (Catalina), 10.14 (Mojave), with Apple-LLVM (Xcode) 11, 12, 64bit.

    Big Sur support is preliminary, as is support for the Apple M1 chip

  • Windows 10 with Visual Studio 2019, 32/64bit.

    There is currently no official support for building/using Geant4 through Windows Subsystem for Linux, but we welcome reports or feedback on use of Geant4 under this system via our Discourse Forum.

The following platforms and compilers are also tested but not officially supported

  • CentOS 7 Linux with Intel C/C++ Compiler >=19.X. Note that the Intel Compiler must be set up to use C++ headers and standard library supplied by GNU GCC >= 4.9 only to provide the required compatibility with the C++11 Standard.

  • CentOS 7 Linux with LLVM/Clang 7, 8, and 9

  • CentOS 8 Linux with GCC 8 and 10

  • Ubuntu Linux 18.04LTS with GCC 7 (system compiler)

  • Ubuntu Linux 20.04LTS with GCC 9 (system compiler)

Prerequisites for Optional Components of Geant4

Geant4 has several optional components which if enabled require further software to be preinstalled on your system. These components and their requirements are listed below.

On Linux, we strongly recommend that you install these through the package management system of your distribution unless these do not meet the version and (for C++ packages) standard requirements listed. You should consult the documentation of your distribution for information on the packages that provide the needed software libraries and headers.

On macOS and Windows, we strongly recommend installing any required packages through binary dmg/exe installers supplied by the vendors of the packages. Installation and use of packages on macOS through Homebrew or MacPorts is not tested, but you may build Geant4 using packages installed through these systems with that caveat.

CLHEP, Expat, and zlib Support Libraries

Geant4 distributes minimal versions of the CLHEP , Expat, and zlib sources with the toolkit to help cross-platform usage.

These internal versions are built and installed by default (except for Expat on Linux and macOS Platforms), but Geant4 can be configured to use existing installs of these packages if required (see Geant4 Build Options for details). If existing installs are used, they must meet the following version/standard requirements:

  • CLHEP: 2.4.4.0 or higher, compiled against the same C++ Standard as Geant4 (C++11 by default)

  • Expat: 2.0.1 or higher

  • zlib: 1.2.3 or higher

GDML XML Geometry Support

To enable use of geometry reading/writing from GDML XML files, the Xerces-C++ headers and library >=3 must be installed, compiled against the same C++ Standard as Geant4 (C++11 by default). On Unix systems, it should also be configured and built with netaccessor-curl, and the used libcurl should support SSL in order to access schema files over https.

User Interface and Visualization Drivers

In addition to the packages listed below for individual drivers, we strongly recommend installing the drivers for the video card on your system (e.g. NVIDIA).

Users of the Wayland window manager will need XWayland for the X11-based drivers below. Our experience is that this solution does co-work with Qt.

  • Qt5 User Interface and Visualization (All Platforms)

    • Qt5 headers and libraries

      • You will need to register personally as an open software developer to obtain a free personal version of Qt.

      • For most platforms you can get a binary installation package.

      • If you are installing individual Qt5 modules, the set required by Geant4 is Qt5Core, Qt5Gui Qt5Widgets, Qt5OpenGL, and Qt5PrintSupport. Use of the optional and experimental Qt3D driver additionally requires Qt5 5.15 and the Qt53DCore, Qt53DExtras and Qt53DRender modules.

      • If you need to compile, Qt5 should preferably be compiled against the same C++ Standard as Geant4 (C++11 by default), but this is not required as its ABI is binary compatible between standards.

    • OpenGL or MesaGL headers and libraries.

  • X11 OpenGL Visualization (Linux and macOS)

  • WIN32 OpenGL Visualization (Windows)

    • OpenGL or MesaGL headers and libraries.

    • Visual Studio supplies a basic install of OpenGL.

  • X11 RayTracer Visualization (Linux and macOS)

    • X11 headers and libraries (XQuartz on macOS).

  • Open Inventor Visualization (All Platforms)

    • Coin3D libraries and headers, version 4.0.0 or newer, plus one the bindings:

    • SoXt libraries and headers, version 1.4.0 or newer

    • SoQt libraries and headers, version 1.6.0 or newer

    • SoWin libraries and headers, version 1.4.0 or newer (SoWin support is provisional)

    • See also Installing Coin3D and SoXt/Qt Bindings

  • Motif User Interface and Visualization (Linux and macOS)

Analysis Features and Backends

The Geant4 analysis library provides a lightweight interface for storing quantities and plots with various backends for persistency (e.g. plain text, XML). Whilst the choice of backend and linking is deferred to the user as required for their application, the following features require presence of additional software when compiling Geant4:

  • Freetype Font Rendering Support (Linux and macOS)

Python Bindings

The Python bindings to Geant4, Geant4Py, may now be built as part of the main Geant4 build and require:

  • Python 3.X interpreter, library, and headers

  • Boost Python 1.69 library and headers, compiled/linked against the required Python version.

Advanced/Experimental Features

Warning

These features are for advanced users only. Note that HDF5 use is experimental.

  • VecGeom Replacements for Geant4 solids

    • VecGeom headers and libraries, version 1.1.8 or newer, compiled against the same C++ Standard as Geant4 (C++11 by default)

  • TiMemory profiling for Geant4 kernel and applications

    • TiMemory headers and library, compiled against the same C++ Standard as Geant4 (C++11 by default)

  • HDF5 Persistency for Geant4 Analysis module

    • HDF5 1.8 or higher C headers and libraries.

    • If Geant4 is built with multithreading support, then the used HDF5 install must have been compiled with thread safety enabled.

Software Suggested for Use With Geant4 Applications

Geant4 includes many cross-platform file-based visualization drivers, together with the lightweight inexlib library for basic analysis. Geant4 does not require any additional software over and above that listed in Geant4 System/Software Prerequisites to build and install these components.

However, you may wish to install the third-party software suggested below to make use of these components when running your Geant4 application. We again emphasise that you do not need these packages to build and install Geant4. Also note that Geant4 cannot provide support on installing or using these packages. Any issues here should be reported to the developers of the package.

  • DAWN postscript renderer (for use with DAWN visualization driver).

  • HepRApp Browser (for use with HepRepFile visualization driver).

  • WIRED4 JAS Plug-In (for use with HepRepXML visualization driver).

  • VRML Browser (for use with VRML visualization driver).

  • OpenScientist interactive environment for analysis.

  • AIDA implementation such as OpenScientist, JAS3 or rAIDA.

  • gMocren volume visualizer for Geant4 medical simulations.

For more details on Geant4’s visualization and analysis components, you should consult the relevant sections in the Geant4 User’s Guide for Application Developers.