Manual installation on macOS (with M1 chip)

The following preliminary procedure works with Monterey (macOS version 12 with M1 chip), for Geant4 version 11.0.0.

We first explain how to install Geant4 in your "home" directory and then how to use the toolkit. We suggest to read the whole procedure first.
The steps described have been updated from the web site of Igor Semeniouk (LLR/IN2P3/CNRS, France, Geant4 version 10.7) whom we thank very much.

A) Installation of Geant4

Users (with root access) can install Geant4 (which includes Geant4-DNA) on a Mac M1 computer following these instructions, once for each new fresh Geant4 installation.

Instructions in pink depend on user choice and instructions in purple depend on software version installed by the Homebrew package manager.

1) Make sure to run the last version of macOS

2) Install the Xcode development framework

3) Install Xcode command line tools by typing the following command in a terminal:

xcode-select --install

4) Install the Homebrew package manager by typing in a terminal:

/bin/bash -c "$(curl -fsSL"

After installation, run the indicated commands to add Homebrew to your PATH. This is needed for the next steps that use brew.

Install the CMake build system by typing in the terminal:

brew install cmake

Note that any
package installed with brew can be removed using brew uninstall package

6) Install the Qt version 5 application development framework by typing in the terminal:

brew install qt@5

7) Define the PKG_CONFIG_PATH environment variable for Qt 5 by typing in the terminal:

export PKG_CONFIG_PATH=/opt/homebrew/Cellar/qt@5/5.15.2_1/lib/pkgconfig/
export PATH=

8) Install the Xerces-C++ XML parser (needed for the handling of GDML files) by typing in the terminal:

brew install xerces-c

9) Install the ROOT data analysis framework

brew install root

10) Download Geant4 version 11.0.0 using git (see Geant4 current version number X.Y.Z such as 11.0.0 at this link).

git clone
cd geant4
git checkout v
cd ..

11) Create a build directory:

mkdir build
cd build

and run CMake to configure the build:


  • the directory /Users/yourname is the "home" directory from which any terminal session starts (check it by typing pwd in the terminal).
  • this cmake command should be typed as a single line, with a space before each "-" and "..". You can get the full command as a text file here.
  • when the option -DGEANT4_INSTALL_DATA=ON is selected, Geant4 datasets are automatically downloaded, but the download can sometimes be very slow; instead, you can ignore this option and install all data files manually as explained in the installation instructions (uncompress each dataset file using tar -xvf filename.tar).

Run the build with (e.g., using 10 cores):

cmake --build . --target install -- -j10

B) How to use Geant4

Create a .zshrc file from the terminal in your "home" directory, using for example :

nano .zshrc

and add the following lines

export PATH=
export G4COMP=

Save your file with control X key combination and answer Y.

2) Source this file with source .zshrc or start a new terminal (from Monterey macOS, the .zshrc file will be read automatically each time you open a new terminal, making your computer fully configured to use Geant4).

3) As an illustration, if you want to test the dnaphysics extended example (with a build on 10 cores), do the following:

cp -R geant4/examples/extended/medical/dnaphysics .
cd dnaphysics
mkdir build
cd build
comp ..
make -j
root plot.C

Updated on 26/02/2022