Unsuccessful compile - libG4ToolsSG: fat file missing arch 'arm64', file has 'i386,x86_64'

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

Geant4 Version: 4.11.3.2
Operating System: MacOS 26.2
Compiler/Version: Apple clang version 17.0.0 (clang-1700.6.3.2)
CMake Version: 4.2.1

Fresh compile on a new M4 laptop had multiple instances of failing while linking shared libraries. Compiled using “make -j10”. The first problem library was the following:

Linking CXX shared library ../BuildProducts/lib/libG4ToolsSG.dylib

with the errors:

‘‘‘

Undefined symbols for architecture arm64:
“_glXChooseVisual”, referenced from:
toolx::X11::session::session(std::__1::basic_ostream<char, std::__1::char_traits>&, unsigned int) in G4ToolsSGX11GLES.cc.o
toolx::X11::session::session(std::__1::basic_ostream<char, std::__1::char_traits>&, unsigned int) in G4ToolsSGX11GLES.cc.o
“_glXCreateContext”, referenced from:
toolx::X11::session::session(std::__1::basic_ostream<char, std::__1::char_traits>&, unsigned int) in G4ToolsSGX11GLES.cc.o
toolx::X11::session::session(std::__1::basic_ostream<char, std::__1::char_traits>&, unsigned int) in G4ToolsSGX11GLES.cc.o
“_glXDestroyContext”, referenced from:
toolx::X11::session::~session() in G4ToolsSGX11GLES.cc.o
“_glXMakeCurrent”, referenced from:
toolx::X11::sg_viewer::win_render() in G4ToolsSGX11GLES.cc.o
toolx::X11::sg_viewer::win_render() in G4ToolsSGX11GLES.cc.o
“_glXQueryVersion”, referenced from:
toolx::X11::session::session(std::__1::basic_ostream<char, std::__1::char_traits>&, unsigned int) in G4ToolsSGX11GLES.cc.o
“_glXSwapBuffers”, referenced from:
toolx::X11::sg_viewer::win_render() in G4ToolsSGX11GLES.cc.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)


Included is the CMakeCache.txt.

CMakeCache.txt (96.8 KB)

Thanks,

Karl

First glace is that this is an Apple Silicon/X11 conflict. As a first step what happens if you just disable X11? i.e.

cmake -DCMAKE_INSTALL_PREFIX=$GEANT4_INSTALL \
      -DGEANT4_USE_OPENGL_X11=OFF \
      -DGEANT4_USE_QT=OFF \
      ../geant4.11.3.2

Toggle on or off QT as you want.

Thanks for the fast reply.

cmake -DCMAKE_INSTALL_PREFIX=$GEANT4_INSTALL
-DGEANT4_USE_OPENGL_X11=OFF
../geant4.11.3.2

The above “OFF” solved the problem.

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