Compiling Geant4 with Qt5 on Apple Silicon

Hi! I am getting started with Geant4 for the first time, and I wish to run Geant4 using Qt5. I do however get the error message posted below. I downloaded Qt5 with the Online installer on their website, version 5.1.15. From the information on the website, this should work for arm64. The error did not appear until I set GEANT4_USE_QT=ON. Before this, it worked. How would you get Geant4 to link with Qt5 on Apple Silicon?

The error:

“operator==(QString const&, QString const&)”, referenced from:
G4UIQt::ChangeCursorAction(QString const&) in G4UIQt.cc.o
G4UIQt::ChangeSurfaceStyle(QString const&) in G4UIQt.cc.o
G4UIQt::ChangePerspectiveOrtho(QString const&) in G4UIQt.cc.o
G4UIQt::AddIcon(char const*, char const*, char const*, char const*) in G4UIQt.cc.o
G4UIQt::FindTreeItem(QTreeWidgetItem*, QString const&) in G4UIQt.cc.o
G4UIQt::CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool) in G4UIQt.cc.o
G4UIQt::CreateCommandWidget(G4UIcommand*, QWidget*, bool) in G4UIQt.cc.o

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hi,

I have Geant4 with Qt5 and X11 visualisation installed on my M1 Mac. I installed both of these via a package manager (MacPorts), and have not had any issues since. I recommend installing all desired Geant4 dependencies via the same package manager (e.g. MacPorts, homebrew, or whatever you may use) and pointing CMake to the corresponding install directories.

Let me know if you get anywhere.

ST

This looks like CMake has probably picked up the x86_64 libraries during configuration rather than arm64. If you’re building with make could you run:

$ make VERBOSE=1 

and post the full link line where the failure occurs please? Could you also check in CMakeCache.txt in your build directory and post the values of any QT... variables please?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.