CMake G4-11.2.0 with AppleClang 15.0.0.15000100

Geant4 Version: 4-11.2.0
Operating System: OSX Ventura 13.6.3
Compiler/Version: AppleClang 15.0.0.15000100
CMake Version: 3.28.1

CMake command:

cmake -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON -DCMAKE_PREFIX_PATH=/opt/homebrew//Cellar/qt@5/5.15.8_2/lib/cmake/Qt5/ -DGEANT4_INSTALL_DATADIR=/Users/joshuaporter/Geant4/geant4-data/ -DCMAKE_BUILD_TYPE=RelWithDebInf ../geant4

I get the following errors just after -- Found Threads: TRUE

CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:627 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:694 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:770 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:628 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:694 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:770 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:627 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:694 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:770 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:628 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:694 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:770 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:627 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:715 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:838 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:628 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:715 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:838 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:627 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:715 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:838 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:628 (_g4tc_setenv_command):
  _g4tc_setenv_command Function invoked with incorrect arguments for function
  named: _g4tc_setenv_command
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:715 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:838 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:91 (include)
  CMakeLists.txt:49 (include)

Any ideas what’s going on here?

Lines 627-628 in cmake/Modules/G4ConfigureGNUMakeHelpers.cmake correspond to use of Qt variables derived from an invocation of qmake. Assuming that Qt’s been found correctly, then those calls and their output would be:

$ /opt/homebrew/Cellar/qt@5/5.15.8_2/bin/qmake -query QT_INSTALL_PREFIX
/opt/homebrew/Cellar/qt@5/5.15.8_2

$ /opt/homebrew/Cellar/qt@5/5.15.8_2/bin/qmake -query QT_INSTALL_LIBS
/opt/homebrew/Cellar/qt@5/5.15.8_2/lib

Can you run those commands and confirm the output is as expected please?

Hi, thanks for the response.

Here’s the output:

zsh: bad CPU type in executable: /opt/homebrew/Cellar/qt@5/5.15.8_2/bin/qmake

I think I know what this is due to. I’m using an old MacBook with an Intel processor with a restored timemachine snapshot of my previous MacBook that had an ARM processor. I’m not sure if Rosetta can be used to run ARM binaries on Intel processors…

I guess I need to find which bit of software was built with ARM and reinstall it.

After uninstalling qt@5 (required manual rm -rf of directory in /Cellar/) and reinstalling, the CMake command now works.

Side note: I’d recommend anyone wanting to specify the location of Qt’s CMake files to use -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)

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