Installation Geant4 v11.0.0 in Macbook M1 Monterey 12.3.1

Dear Geant4 experts,

I hope you are all well. I am trying to install Geant4 on a Macbook Air with M1 chip and Monterey 12.3.1 following this guide:
Installation on macOS (M1)

Apart from the software included there, I have also installed “expat” with homebrew following the guide in which the previous one is based:

I obtain the error that can be found in the attached document.

Which I believe is related to Qt5 somehow. I have uninstalled and installed everything several times to see that it was up to date.

Even though I am trying to install v11.0.0, I would be interested in installing any version of Geant4 (the more recent, the better).

Any help would be extremely appreciated. Thank you very much in advance!

Best wishes,

error-install.txt (81.3 KB)

Update: Qt5 must be the problem because I successfully installed Geant4 by setting

ld: warning: ignoring file /opt/local/libexec/qt5/lib/QtWidgets.framework/QtWidgets, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

It looks like CMake has picked up an existing Qt install in /opt/ rather than the Home-brew one. The /opt/ version is for Intel/x86 rather than ARM hence the error message.

It should be possible to point Geant4 to the correct Qt install by doing

$ cmake -DCMAKE_PREFIX_PATH="/usr/local/opt/qt@5" <anyotherargs>

Dear @bmorgan,

Thank you for your reply! I also managed to fix it by realising that I made a mistaken when typing:

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

export PATH=/opt/homebrew/Cellar/qt@5/5.15.2_1/bin:$PATH"

following the manual. I entered the example path instead of the one I had downloaded.

(I share this in case it happens to someone else).


Hello, how is your experience running Geant4 on M1? I’m stuck with installing big time on my M1 Air. Can you kindly guide me?

Dear @Debodyuti_Kar,

I am no expert on these kinds of topics, the only thing I did was following the guide I mentioned above step by step (which included, for example, upgrading my system to the newest version) and then make the changes necessary to use the software I installed.

I hope this helps.


Thank you for your response! I actually was able to successfully setup Geant4 following those steps in my M1. It even simulates dnaphysics no problem…but throwing ‘linker error’ for B1 example. Did you have any luck with that?

Dear @Debodyuti_Kar,

Glad to hear, I think it’ll be best if you shared your full error here so that it can be assessed.


Dear @danipuerta,

Well, I just realised I was not compiling in the build directory! Now it fixed, it was super silly of me!