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++17 Standard:

    • Linux: GNU Compiler Collection 8 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) 13 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.

  • CMake 3.16 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:

  • RHEL/Alma/Rocky 9 Linux with GCC >=11.2, >=12.2, 13.2 64 bits

    Geant4 has been successfully compiled on other Linux distributions, including Debian, Ubuntu, Arch, and Gentoo. The main requirement is that the system has a GCC of sufficient version to support C++17 installed. Please note that distributions other than RHEL/Alma/Rocky are not officially supported. However, feedback and patches for other distributions are welcome!

  • macOS 14 (Sonoma), 13 (Ventura), 12 (Monterey) with Apple-LLVM (Xcode) 14, 15, Intel and ARM.

  • Windows 10 with Visual Studio 2022, 64bit.

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

    Windows 11 is not officially tested yet, though we have had reports of successful use. We welcome reports or feedback on use of Geant4 on Windows 11 via our Discourse Forum.

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

  • CentOS 7 Linux with GCC >=8.3, >=9.3, >=10.3, >=11.2, >=12.2, 13.2 64 bits The minimum required versions of GCC may be installed on CentOS7 systems via the free Developer Toolset packages.

  • CentOS 7 Linux with Intel C/C++ Legacy or LLVM Compilers >=20.X. Note that the Intel Compiler must be set up to use C++ headers and standard library supplied by GNU GCC >= 8 to provide the required compatibility with the C++17 Standard.

  • CentOS 7, RHEL/Alma/Rocky 9 Linux with LLVM/Clang 14, 15, 16, 17

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

  • Ubuntu Linux 22.04LTS with GCC 11 (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.6.0 or higher, compiled against the same C++ Standard as Geant4 (C++17 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++17 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

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

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

      • If you are installing individual Qt5 modules, the set required by Geant4 is Qt5Core, Qt5Gui Qt5Widgets, and Qt5OpenGL. 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++17 by default), but this is not required as its ABI is binary compatible between standards.

    • OpenGL or MesaGL headers and libraries.

  • VTK Visualization (All Platforms)

    • VTK libraries and headers, version 9 or newer, with Qt support.

  • ToolsSG Visualization (All Platforms)

    • X11 backend: X11 headers and libraries (XQuartz on macOS).

    • Xt backend: Motif headers and libraries.

    • Qt backend: Qt headers and libraries as documented above.

    • Windows backend: see below.

    • All backends require 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)

Advanced/Beta/Experimental Features

Warning

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

  • VecGeom Replacements for Geant4 solids

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

  • Qt6 User Interface and Visualization (All Platforms)

  • 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 file visualization driver).

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

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

  • 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.