I am attempting to build geant4 v4.10.06.p03 on an M1 mac (running Big Sur, 11.6) with qt enabled. I have qt installed using homebrew and have been able to successfully install geant4 without the option turned on.
I paste a truncated error message below following running the cmake command:
cmake -DCMAKE_INSTALL_PREFIX=../geant4.10.06.p03 ../geant4.10.06.p03 -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON
Error message after running make:
[ 2%] Built target G4clhep
[ 4%] Built target G4global
[ 5%] Built target G4intercoms
[ 5%] Built target G4zlib
[ 7%] Built target G4analysis
[ 8%] Built target G4materials
[ 8%] Built target G4graphics_reps
[ 16%] Built target G4geometry
Consolidate compiler generated dependencies of target G4particles
[ 22%] Built target G4particles
Consolidate compiler generated dependencies of target G4track
[ 23%] Built target G4track
Consolidate compiler generated dependencies of target G4digits_hits
[ 26%] Built target G4digits_hits
Consolidate compiler generated dependencies of target G4processes
[ 81%] Built target G4processes
Consolidate compiler generated dependencies of target G4tracking
[ 82%] Built target G4tracking
Consolidate compiler generated dependencies of target G4event
[ 83%] Built target G4event
Consolidate compiler generated dependencies of target G4run
[ 84%] Built target G4run
Consolidate compiler generated dependencies of target G4error_propagation
[ 85%] Built target G4error_propagation
[ 85%] Linking CXX shared library ../../BuildProducts/lib/libG4interfaces.dylib
ld: warning: ignoring file /Users/mistryk2/opt/anaconda3/lib/libQt5PrintSupport.5.9.7.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/mistryk2/opt/anaconda3/lib/libQt5Widgets.5.9.7.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/mistryk2/opt/anaconda3/lib/libQt5Gui.5.9.7.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/mistryk2/opt/anaconda3/lib/libQt5Core.5.9.7.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)", referenced from:
G4UIQt::G4UIQt(int, char**) in G4UIQt.cc.o
G4UIQt::CreateViewerWidget() in G4UIQt.cc.o
G4UIQt::CreateUITabWidget() in G4UIQt.cc.o
G4UIQt::CreateCoutTBWidget() in G4UIQt.cc.o
G4UIQt::SetDefaultIconsToolbar() in G4UIQt.cc.o
QString::~QString() in G4UIQt.cc.o
int qRegisterMetaType<QTextCursor>(char const*, QTextCursor*, QtPrivate::MetaTypeDefinedHelper<QTextCursor, (QMetaTypeId2<QTextCursor>::Defined) && (!(QMetaTypeId2<QTextCursor>::IsBuiltIn))>::DefinedType) in G4UIQt.cc.o
"QString::trimmed_helper(QString const&)", referenced from:
G4UIQt::OpenHelpTreeOnCommand(QString const&) in G4UIQt.cc.o
G4UIQt::CommandEnteredCallback() in G4UIQt.cc.o
"QString::trimmed_helper(QString&)", referenced from:
G4UIQt::FillHelpTree() in G4UIQt.cc.o
G4UIQt::ReceiveG4cout(G4String const&) in G4UIQt.cc.o
G4UIQt::ReceiveG4cerr(G4String const&) in G4UIQt.cc.o
G4UIQt::CreateHelpTree(QTreeWidgetItem*, G4UIcommandTree*) in G4UIQt.cc.o
G4UIQt::CommandEnteredCallback() in G4UIQt.cc.o
G4UIQt::LookForHelpStringCallback() in G4UIQt.cc.o
"QString::fromUtf8_helper(char const*, int)", referenced from:
operator+(QString const&, char const*) in G4UIQt.cc.o
G4UIQt::AddIcon(char const*, char const*, char const*, char const*) in G4UIQt.cc.o
G4UIQt::OpenHelpTreeOnCommand(QString const&) in G4UIQt.cc.o
G4UIQt::CreateCommandWidget(G4UIcommand*, QWidget*, bool) in G4UIQt.cc.o
G4UIQt::GetLongCommandPath(QTreeWidgetItem*) in G4UIQt.cc.o
G4UIQt::GetCommandList(G4UIcommand const*) in G4UIQt.cc.o
G4UIQt::updateHelpArea(G4UIcommand const*) in G4UIQt.cc.o
...
"QTextEdit::toPlainText() const", referenced from:
G4UIQt::SaveOutputCallback() in G4UIQt.cc.o
"QTextEdit::textColor() const", referenced from:
G4UIQt::ReceiveG4cout(G4String const&) in G4UIQt.cc.o
G4UIQt::ReceiveG4cerr(G4String const&) in G4UIQt.cc.o
"typeinfo for QTabWidget", referenced from:
typeinfo for G4QTabWidget in G4UIQt.cc.o
"typeinfo for QDockWidget", referenced from:
typeinfo for G4UIDockWidget in G4UIQt.cc.o
"typeinfo for QGridLayout", referenced from:
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
"typeinfo for QPushButton", referenced from:
G4UIQt::CreateCommandWidget(G4UIcommand*, QWidget*, bool) in G4UIQt.cc.o
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
G4UIQt::ChangeColorCallback(QWidget*) in G4UIQt.cc.o
"typeinfo for QScrollArea", referenced from:
G4UIQt::CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool) in G4UIQt.cc.o
"typeinfo for QRadioButton", referenced from:
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
"typeinfo for QLabel", referenced from:
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
"typeinfo for QDialog", referenced from:
G4UIQt::CreateCommandWidget(G4UIcommand*, QWidget*, bool) in G4UIQt.cc.o
"typeinfo for QLayout", referenced from:
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
"typeinfo for QObject", referenced from:
G4UIQt::CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool) in G4UIQt.cc.o
typeinfo for G4UIQt in moc_G4UIQt.cpp.o
"typeinfo for QWidget", referenced from:
G4UIQt::CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool) in G4UIQt.cc.o
G4UIQt::CreateCommandWidget(G4UIcommand*, QWidget*, bool) in G4UIQt.cc.o
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
G4UIQt::ChangeColorCallback(QWidget*) in G4UIQt.cc.o
G4QTabWidget::paintEvent(QPaintEvent*) in G4UIQt.cc.o
"typeinfo for QToolBox", referenced from:
G4UIQt::CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool) in G4UIQt.cc.o
"typeinfo for QComboBox", referenced from:
G4UIQt::CreateCommandWidget(G4UIcommand*, QWidget*, bool) in G4UIQt.cc.o
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
"typeinfo for QGroupBox", referenced from:
G4UIQt::CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool) in G4UIQt.cc.o
"typeinfo for QLineEdit", referenced from:
G4UIQt::CreateCommandWidget(G4UIcommand*, QWidget*, bool) in G4UIQt.cc.o
G4UIQt::VisParameterCallback(QWidget*) in G4UIQt.cc.o
"typeinfo for QTextEdit", referenced from:
G4QTabWidget::paintEvent(QPaintEvent*) in G4UIQt.cc.o
"non-virtual thunk to QWidget::redirected(QPoint*) const", referenced from:
vtable for G4QTabWidget in G4UIQt.cc.o
vtable for G4UIDockWidget in G4UIQt.cc.o
"non-virtual thunk to QWidget::initPainter(QPainter*) const", referenced from:
vtable for G4QTabWidget in G4UIQt.cc.o
vtable for G4UIDockWidget in G4UIQt.cc.o
"non-virtual thunk to QWidget::paintEngine() const", referenced from:
vtable for G4QTabWidget in G4UIQt.cc.o
vtable for G4UIDockWidget in G4UIQt.cc.o
"non-virtual thunk to QWidget::sharedPainter() const", referenced from:
vtable for G4QTabWidget in G4UIQt.cc.o
vtable for G4UIDockWidget in G4UIQt.cc.o
"non-virtual thunk to QWidget::metric(QPaintDevice::PaintDeviceMetric) const", referenced from:
vtable for G4QTabWidget in G4UIQt.cc.o
vtable for G4UIDockWidget in G4UIQt.cc.o
"non-virtual thunk to QWidget::devType() const", referenced from:
vtable for G4QTabWidget in G4UIQt.cc.o
vtable for G4UIDockWidget in G4UIQt.cc.o
"operator==(QString const&, QString const&)", referenced from:
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
G4UIQt::ChangeCursorAction(QString const&) in G4UIQt.cc.o
G4UIQt::ChangeSurfaceStyle(QString const&) in G4UIQt.cc.o
G4UIQt::ChangePerspectiveOrtho(QString const&) 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)
make[2]: *** [BuildProducts/lib/libG4interfaces.dylib] Error 1
make[1]: *** [source/interfaces/CMakeFiles/G4interfaces.dir/all] Error 2
make: *** [all] Error 2
The compilation works with qt turned off: -DGEANT4_USE_QT=OFF.
Any help with this would be greatly appreciated. Thanks!