MacOS Sequoia 15.1 installing Geant4

_Geant4 Version:_v11.2.2
_Operating System:_Mac OS Sequoia 15.1
Compiler/Version:

  • edwardt@onc-0986 Geant4 % gcc -v
    Apple clang version 16.0.0 (clang-1600.0.26.4)
    Target: arm64-apple-darwin24.1.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin

  • edwardt@onc-0986 Geant4 % clang -v
    Apple clang version 16.0.0 (clang-1600.0.26.4)
    Target: arm64-apple-darwin24.1.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bi

  • edwardt@onc-0986 Geant4 % g++ -v
    Using built-in specs.
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/arm64-apple-darwin21/12.3.0/lto-wrapper
    Target: arm64-apple-darwin21
    Configured with: [had to delete this because it contained weblinks - limited to 2 in this post]
    sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
    Thread model: posix
    Supported LTO compression algorithms: zlib zstd
    gcc version 12.3.0 (MacPorts gcc12 12.3.0_4+stdlib_flag)

[ this makes me a bit worried because my MacOSX.sdk is MacOSX15.1.sdk in the folder]

CMake Version:

  • edwardt@onc-0986 Geant4 % cmake --version
    cmake version 3.31.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

#-----------------------------------------

Hi so I upgraded my laptop to macOS Sequoia 15.1 the other day. I downloaded both the binaries and source codes from the download part of the website

  • I made a folder “Geant4” where I unpacked the .tar source file geant4-v11.2.2
  • I put the binary release here too which I unpacked [the Darwin-clang15.0.0-Sonoma.tar], which was named Geant4-11.2.2-Darwin
  • I made the geant4-v11.2.2-build folder as specified on: Building and Installing from Source — Geant4 Installation Guide 11.2 documentation
  • I was confused by the step - e.g. “cmake -DCMAKE_INSTALL_PREFIX=/path/to/geant4-v11.2.0-install /path/to/geant4-v11.2.0”, as there is no geant4-v11.2.0-install folder anywhere
  • I didn’t know what to do so I renamed the Geant4-11.2.2-Darwin folder, geant4-v11.2.2-install as I looked at the file structure of the share/data and it followed the same structure so I assumed this is what was meant
  • I put the data files from online into the share/Geant4-11.2.2/data folder in the geant4-v11.2.2-install directory
  • I ran:
$ cd /path/to/geant4-v11.2.2-build
$ cmake -DGEANT4_INSTALL_DATA=ON -DCMAKE_INSTALL_PREFIX=/path/to/geant4-v11.2.2-install  /Users/edwardt/Documents/Geant4/geant4-v11.2.2
  • I do not know which (gcc / g++) settings I should use gcc14 (with home-brew) or clang - I had set it to gcc-14 and g+±14 arbitrarily in my ~/.zshrc:
export PATH="/opt/homebrew/bin/g++-14:$PATH"
export PATH="/opt/homebrew/bin/gcc-14:$PATH"
export CC=gcc-14
export CXX=g++-14

there I also put for the data files:

export G4LEDATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/G4EMLOW8.5
export G4LEVELGAMMADATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/PhotonEvaporation5.7
export G4PARTICLEXSDATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/G4PARTICLEXS4.0
export G4ENSDFSTATEDATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/G4ENSDFSTATE2.3
export G4RADIOACTIVEDATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/RadioactiveDecay5.6
export G4NEUTRONHPDATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/G4NDL4.7.1
export G4PARTICLEHPDATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/G4TENDL1.4
export G4NEUTRONHPDATA=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/data/G4NDL4.7.1

and the

source /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/share/Geant4/geant4make/geant4make.sh
source /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/bin/geant4.sh
make -j 10
make install
  • Then when I go into /Users/edwardt/Documents/Geant4/geant4-v11.2.2/examples/extended/runAndEvent/RE02/build
  • and do:
cmake -S .. -B .
CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_INCLUDE_DIR' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:18 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_LIBRARY' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:19 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:9 (message):
  Value of 'OPENGL_INCLUDE_DIR' is already set and does not match value set
  at Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:35 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:9 (message):
  Value of 'OPENGL_gl_LIBRARY' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:36 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


CMake Deprecation Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/PTL/PTLConfig.cmake:30 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.
Call Stack (most recent call first):
  /opt/homebrew/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:286 (find_dependency)
  CMakeLists.txt:13 (find_package)


-- Configuring done (0.3s)
CMake Error in CMakeLists.txt:
  Imported target "Geant4::G4Tree" includes non-existent path

    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error in CMakeLists.txt:
  Imported target "Geant4::G4Tree" includes non-existent path

    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



-- Generating done (0.1s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

Similarly if I go to a folder outside the examples, like a project I created with an old version of Geant4 I had installed which is based on RE02 /Users/edwardt/Documents/RE02_hemisphere and do

edwardt@onc-0986 build_example % cmake -S .. -B .              
CMake Deprecation Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/PTL/PTLConfig.cmake:30 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.
Call Stack (most recent call first):
  /opt/homebrew/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:286 (find_dependency)
  CMakeLists.txt:13 (find_package)


-- Configuring done (0.4s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/edwardt/Documents/RE02_hemisphere/build_example

and then

make -j 10
edwardt@onc-0986 build_example % make -j 10
[  4%] Building CXX object CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o
[  8%] Building CXX object CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o
[ 16%] Building CXX object CMakeFiles/RE02.dir/src/RE02Run.cc.o
[ 16%] Building CXX object CMakeFiles/RE02.dir/src/RE02RunAction.cc.o
[ 20%] Building CXX object CMakeFiles/RE02.dir/src/RE02SteppingAction.cc.o
[ 25%] Building CXX object CMakeFiles/RE02.dir/src/RE02PrimaryGeneratorAction.cc.o
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02NestedPhantomParameterisation.cc:31:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/include/Geant4/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:247: CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02DetectorConstruction.cc:44:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/include/Geant4/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:219: CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/RE02.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
edwardt@onc-0986 build_example % 
  • I had the error with number 12912/23 with the “Imported target “Geant4::G4Tree” includes non-existent path” which was occurring
  • So I deleted the file as you said: in the folder /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake
  • To note: I have QT5 for the visualisation stuff referenced in the ~/.zshrc
export QTDIR=/opt/homebrew/Cellar/qt@5/5.15.16
  • I don’t know how to fix all these things and would appreciate any help / a checklist of instructions that are a bit clearer than the webpage especially as I am aware the M1 arm64 architecture has some quirks when installing Geant4. I also know this is not unique to Geant4 as I have the same installation issues with EGSnrc too (hence why I avoided clang and went to gcc-14/g+±14)

There’s no need to download both the binaries and source code package - pick one, and I’d suggest the source code given this is the latest macOS. My suspicion is that as you’ve downloaded both the binary and source packages, and appears you haven’t built or installed Geant4, it’s picking up the binary. I’d suggest the following:

  1. Delete the /Users/edwardt/Documents/Geant4/geant4-v11.2.2 directory, and redownload/unpack the 11.2.2 source code tarball here.
  2. Remove GCC from the path and unset the CC and CXX variables from the environment. The system clang will be absolutely fine. You also don’t need to set the env vars for the datasets anymore, so unset these as well.
  3. Build and install Geant4 from source following the instructions in the Installation Guide. Do not worry that these say “11.2.0”, this is purely because these only track the minor, not patch version. Everywhere these say “11.2.0”, you can replace with “11.2.2”.
  4. If you’ve built and installed with that cmake -DGEANT4_INSTALL_DATA=ON option, then the env vars are not needed: see the relevant section here.

You can then try rebuilding the example, but I’d strongly suggest copying from the install/source location to a separate directory.

Hi Ben,

Thanks for the message, I did the above, then in the example within the v11.2.2 folder I did:

edwardt@onc-0986 build % cmake -S .. -B .
CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_INCLUDE_DIR' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/Geant4PackageCache.cmake:18 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_LIBRARY' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/Geant4PackageCache.cmake:19 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


-- Configuring done (0.2s)
CMake Error in CMakeLists.txt:
  Imported target "Geant4::G4Tree" includes non-existent path

    "/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error in CMakeLists.txt:
  Imported target "Geant4::G4Tree" includes non-existent path

    "/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



-- Generating done (0.1s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
edwardt@onc-0986 build % pwd
/Users/edwardt/Documents/Geant4/geant4-v11.2.2/examples/extended/runAndEvent/RE02/build

I used to have Geant4 version 11.0.2 installed and used 12.3.sdk from the /Library/Developer/CommandLineTools/SDKs/ folder, I had removed the folders (similar ones to the ones I’ve made for this version) and did:
sudo rm -rf /usr/local/Geant4
There’s now nothing set within my ~/.zshrc file

If I do:

ccmake -S .. -B .
 CMAKE_BUILD_TYPE                 Release
 CMAKE_INSTALL_PREFIX             /usr/local
 CMAKE_OSX_ARCHITECTURES
 CMAKE_OSX_DEPLOYMENT_TARGET      15.1
 CMAKE_OSX_SYSROOT                /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 EXPAT_LIBRARY_RELEASE            /opt/homebrew/Cellar/expat/2.6.4/lib/libexpat.dylib
 Geant4_DIR                       /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build
 PTL_DIR                          /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/externals/ptl
 Qt5Core_DIR                      /opt/homebrew/opt/qt5/lib/cmake/Qt5Core
 Qt5Gui_DIR                       /opt/homebrew/opt/qt5/lib/cmake/Qt5Gui
 Qt5OpenGL_DIR                    /opt/homebrew/opt/qt5/lib/cmake/Qt5OpenGL
 Qt5PrintSupport_DIR              /opt/homebrew/opt/qt5/lib/cmake/Qt5PrintSupport
 Qt5Widgets_DIR                   /opt/homebrew/opt/qt5/lib/cmake/Qt5Widgets
 WITH_GEANT4_UIVIS                ON

and to bear in mind:

ls -l /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
lrwxr-xr-x  1 root  wheel  14 Nov 21 18:14 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -> MacOSX15.1.sdk

I’m a bit confused as to why it’s still finding the old SDK. Have you reinstalled/upgraded the Homebrew packages as well?

The only obvious thing I can see is that the Homebrew expat library is being used/picked up, and generally that shouldn’t be needed on macOS (Xcode provides this).

Yes I think that may have been an issue too, I have had to comment out the lines:

#export PATH="/opt/homebrew/opt/expat/bin:$PATH"
#export LDFLAGS="-L/opt/homebrew/opt/expat/lib"
#export CPPFLAGS="-I/opt/homebrew/opt/expat/include"
#export PKG_CONFIG_PATH="/opt/homebrew/opt/expat/lib/pkgconfig"

in my ~/.zshrc

I now try to run the examples RE02 or RE01 and it can do the cmake -S … -B . and make -j 10 commands,
then when running it does:


=========================================================================
--> G4TaskRunManager::CreateAndStartWorkers() --> Initializing workers...
=========================================================================

Idle> 

If I put a batch script / .mac after it seems to be ok for the example files

For my old scripts that used to run on 11.0.2 it does this:

edwardt@onc-0986 RE02_hemisphere % cd build
edwardt@onc-0986 build % cmake -S .. -B .
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found EXPAT: /opt/homebrew/Cellar/expat/2.6.4/lib/libexpat.dylib (found suitable version "2.2.5", minimum required is "2.2.5")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Geant4: /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/Geant4Config.cmake (found version "11.2.2")
-- Configuring done (2.9s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/edwardt/Documents/RE02_hemisphere/build
edwardt@onc-0986 build % make -j 10
[  4%] Building CXX object CMakeFiles/RE02.dir/RE02.cc.o
[  8%] Building CXX object CMakeFiles/RE02.dir/src/G4PSFlatSurfaceFlux.cc.o
[ 12%] Building CXX object CMakeFiles/RE02.dir/src/OptnBremSplitting.cc.o
[ 16%] Building CXX object CMakeFiles/RE02.dir/src/G4PSDoseDeposit.cc.o
[ 20%] Building CXX object CMakeFiles/RE02.dir/src/G4SDPrimaryFilter.cc.o
[ 25%] Building CXX object CMakeFiles/RE02.dir/src/G4PSSphereSurfaceCurrent.cc.o
[ 29%] Building CXX object CMakeFiles/RE02.dir/src/G4PSCellCharge.cc.o
[ 33%] Building CXX object CMakeFiles/RE02.dir/src/G4PSDoseDeposit3D.cc.o
[ 37%] Building CXX object CMakeFiles/RE02.dir/src/OptrBremSplitting.cc.o
[ 41%] Building CXX object CMakeFiles/RE02.dir/src/RE02ActionInitialization.cc.o
[ 45%] Building CXX object CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o
[ 50%] Building CXX object CMakeFiles/RE02.dir/src/RE02EventAction.cc.o
[ 54%] Building CXX object CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o
[ 58%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSFlatSurfaceFlux.cc.o
[ 62%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSFlatSurfaceCurrent.cc.o
[ 66%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSNofStep.cc.o
[ 70%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSPassageCellFlux.cc.o
[ 75%] Building CXX object CMakeFiles/RE02.dir/src/RE02PVSphereParameterised.cc.o
[ 79%] Building CXX object CMakeFiles/RE02.dir/src/RE02Physics.cc.o
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02NestedPhantomParameterisation.cc:31:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/geometry/management/include/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:244: CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02DetectorConstruction.cc:44:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/geometry/management/include/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:216: CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/RE02.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
edwardt@onc-0986 build % vi ~/.zshrc
edwardt@onc-0986 build % source ~/.zshrc
edwardt@onc-0986 build % make -j 10     
[  4%] Building CXX object CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o
[  8%] Building CXX object CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o
[ 12%] Building CXX object CMakeFiles/RE02.dir/src/RE02Run.cc.o
[ 16%] Building CXX object CMakeFiles/RE02.dir/src/RE02PrimaryGeneratorAction.cc.o
[ 20%] Building CXX object CMakeFiles/RE02.dir/src/RE02RunAction.cc.o
[ 25%] Building CXX object CMakeFiles/RE02.dir/src/RE02SteppingAction.cc.o
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02NestedPhantomParameterisation.cc:31:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/geometry/management/include/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02DetectorConstruction.cc:44:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/geometry/management/include/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:244: CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:216: CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/RE02.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
edwardt@onc-0986 build % cd ..
edwardt@onc-0986 RE02_hemisphere % cd build_example    
edwardt@onc-0986 build_example % make clean
edwardt@onc-0986 build_example % cmake -S .. -B .
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_LIBRARY' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:19 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


CMake Warning at /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_LIBRARY_RELEASE' is already set and does not match value
  set at Geant4 build-time
Call Stack (most recent call first):
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4PackageCache.cmake:20 (geant4_set_and_check_package_variable)
  /Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/lib/cmake/Geant4/Geant4Config.cmake:248 (include)
  CMakeLists.txt:13 (find_package)


-- Configuring done (1.6s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/edwardt/Documents/RE02_hemisphere/build_example
edwardt@onc-0986 build_example % make -j 10
[  4%] Building CXX object CMakeFiles/RE02.dir/RE02.cc.o
[  8%] Building CXX object CMakeFiles/RE02.dir/src/G4PSCellCharge.cc.o
[ 12%] Building CXX object CMakeFiles/RE02.dir/src/G4PSDoseDeposit.cc.o
[ 16%] Building CXX object CMakeFiles/RE02.dir/src/OptnBremSplitting.cc.o
[ 20%] Building CXX object CMakeFiles/RE02.dir/src/G4SDPrimaryFilter.cc.o
[ 25%] Building CXX object CMakeFiles/RE02.dir/src/G4PSFlatSurfaceFlux.cc.o
[ 29%] Building CXX object CMakeFiles/RE02.dir/src/OptrBremSplitting.cc.o
[ 33%] Building CXX object CMakeFiles/RE02.dir/src/G4PSDoseDeposit3D.cc.o
[ 37%] Building CXX object CMakeFiles/RE02.dir/src/RE02ActionInitialization.cc.o
[ 41%] Building CXX object CMakeFiles/RE02.dir/src/G4PSSphereSurfaceCurrent.cc.o
[ 45%] Building CXX object CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o
[ 50%] Building CXX object CMakeFiles/RE02.dir/src/RE02EventAction.cc.o
[ 54%] Building CXX object CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o
[ 58%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSFlatSurfaceCurrent.cc.o
[ 62%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSFlatSurfaceFlux.cc.o
[ 66%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSNofStep.cc.o
[ 70%] Building CXX object CMakeFiles/RE02.dir/src/RE02PSPassageCellFlux.cc.o
[ 75%] Building CXX object CMakeFiles/RE02.dir/src/RE02PVSphereParameterised.cc.o
[ 79%] Building CXX object CMakeFiles/RE02.dir/src/RE02Physics.cc.o
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02NestedPhantomParameterisation.cc:31:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/include/Geant4/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
In file included from /Users/edwardt/Documents/RE02_hemisphere/src/RE02DetectorConstruction.cc:44:
/Users/edwardt/Documents/RE02_hemisphere/include/RE02NestedPhantomParameterisation.hh:41:7: error: definition of type 'G4VTouchable' conflicts with type alias of the same name
   41 | class G4VTouchable; 
      |       ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install/include/Geant4/G4VTouchable.hh:39:7: note: 'G4VTouchable' declared here
   39 | using G4VTouchable = G4TouchableHistory;
      |       ^
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:244: CMakeFiles/RE02.dir/src/RE02NestedPhantomParameterisation.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 83%] Building CXX object CMakeFiles/RE02.dir/src/RE02PrimaryGeneratorAction.cc.o
[ 87%] Building CXX object CMakeFiles/RE02.dir/src/RE02Run.cc.o
1 error generated.
make[2]: *** [CMakeFiles/RE02.dir/build.make:216: CMakeFiles/RE02.dir/src/RE02DetectorConstruction.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/RE02.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
edwardt@onc-0986 build_example % 

The compile errors are due to changes in the inheritance of G4VTouchable. The Release Notes for 11.2 state in Section 3 (Migrations) under Geometry, Fields and Transportation:

  • The inheritance level for G4TouchableHistory has been removed, simplifying touchables handling. G4VTouchable is now a simple typedef of G4TouchableHistory, therefore forward declarations of G4VTouchable in the code will have to be promoted to concrete inclusion of the related header file.

So it should be sufficient to remove the forward declaration and add a #include "G4VTouchable.hh".

Thanks Ben, I did this, I also realised that I hadn’t installed any of the visualisation stuff:

edwardt@onc-0986 build % geant4-config --help
....
Known Features:
 staticlibs[no]
 multithreading[yes]
 smartstack[no]
 php_as_hp[no]
 clhep[yes]
 expat[no]
 zlib[yes]
 gdml[no]
 ptl[yes]
 usolids[no]
 freetype[no]
 hdf5[no]
 g3tog4[no]
 qt[no]
 qt3d[no]
 motif[no]
 raytracer-x11[no]
 opengl-x11[no]
 openinventor[no]
 vtk[no]
...

I went to /Users/edwardt/Documents/Geant4/geant4-v11.2.2-build folder and did

cmake -DCMAKE_INSTALL_PREFIX=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install /Users/edwardt/Documents/Geant4/geant4-v11.2.2 -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON
make -j 10

which resulted in:

[ 97%] Building CXX object source/CMakeFiles/G4ToolsSG.dir/visualization/ToolsSG/src/G4ToolsSGQtZB.cc.o
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/ToolsSG/src/G4ToolsSGQtGLESViewer.cc:28:
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:16:2: error: "This file was generated using the moc from 5.15.16. It"
   16 | #error "This file was generated using the moc from 5.15.16. It"
      |  ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:17:2: error: "cannot be used with the include files from this version of Qt."
   17 | #error "cannot be used with the include files from this version of Qt."
      |  ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:18:2: error: "(The moc has changed too much.)"
   18 | #error "(The moc has changed too much.)"
      |  ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:35:1: error: use of undeclared identifier 'Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET'
   35 | QT_MOC_LITERAL(0, 0, 26), // "G4ToolsSGQtDestroyCallback"
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:29:5: note: expanded from macro 'QT_MOC_LITERAL'
   29 |     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
      |     ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:36:1: error: use of undeclared identifier 'Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET'
   36 | QT_MOC_LITERAL(1, 27, 7), // "execute"
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:29:5: note: expanded from macro 'QT_MOC_LITERAL'
   29 |     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
      |     ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:37:1: error: use of undeclared identifier 'Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET'
   37 | QT_MOC_LITERAL(2, 35, 0) // ""
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:29:5: note: expanded from macro 'QT_MOC_LITERAL'
   29 |     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
      |     ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:79:1: error: unknown type name 'QT_INIT_METAOBJECT'
   79 | QT_INIT_METAOBJECT const QMetaObject G4ToolsSGQtDestroyCallback::staticMetaObject = { {
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:79:37: error: expected ';' after top level declarator
   79 | QT_INIT_METAOBJECT const QMetaObject G4ToolsSGQtDestroyCallback::staticMetaObject = { {
      |                                     ^
[ 97%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsNuBeam.cc.o
[ 97%] Building CXX object source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLStoredX.cc.o
8 errors generated.
make[2]: *** [source/CMakeFiles/G4ToolsSG.dir/build.make:149: source/CMakeFiles/G4ToolsSG.dir/visualization/ToolsSG/src/G4ToolsSGQtGLESViewer.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 97%] Building CXX object source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLStoredXViewer.cc.o
[ 97%] Building CXX object source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLXViewer.cc.o
[ 97%] Building CXX object source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLImmediateQt.cc.o
[ 97%] Building CXX object source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc.o
[ 97%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsQGS_BIC.cc.o
[ 97%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsQGSP_BERT.cc.o
[ 98%] Building CXX object source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLQt.cc.o
[ 98%] Building CXX object source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc.o
[ 98%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsQGSP_BERT_HP.cc.o
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLImmediateQt.cc:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh:43:
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtCore.framework/Headers/qobject.h:266:43: error: no template named 'QSlotObject' in namespace 'QtPrivate'
  266 |                            new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
      |                                ~~~~~~~~~~~^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtCore.framework/Headers/qobject.h:305:43: error: no template named 'QStaticSlotObject' in namespace 'QtPrivate'
  305 |                            new QtPrivate::QStaticSlotObject<Func2,
      |                                ~~~~~~~~~~~^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtCore.framework/Headers/qobject.h:344:43: error: no template named 'QFunctorSlotObject' in namespace 'QtPrivate'
  344 |                            new QtPrivate::QFunctorSlotObject<Func2, SlotArgumentCount,
      |                                ~~~~~~~~~~~^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLImmediateQt.cc:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh:45:
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:134:31: error: unknown type name 'QMatrix'
  134 |     QPixmap transformed(const QMatrix &, Qt::TransformationMode mode = Qt::FastTransformation) const;
      |                               ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:136:12: error: unknown type name 'QMatrix'
  136 |     static QMatrix trueMatrix(const QMatrix &m, int w, int h);
      |            ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:136:37: error: unknown type name 'QMatrix'
  136 |     static QMatrix trueMatrix(const QMatrix &m, int w, int h);
      |                                     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:193:5: error: unknown type name 'Q_DUMMY_COMPARISON_OPERATOR'
  193 |     Q_DUMMY_COMPARISON_OPERATOR(QPixmap)
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:193:41: error: expected ';' at end of declaration list
  193 |     Q_DUMMY_COMPARISON_OPERATOR(QPixmap)
      |                                         ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLImmediateQt.cc:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh:57:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/QOpenGLWidget:1:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qopenglwidget.h:47:
In file included from /opt/homebrew/include/QtWidgets/QWidget:1:
In file included from /opt/homebrew/include/QtWidgets/qwidget.h:22:
In file included from /opt/homebrew/include/QtGui/qcursor.h:10:
/opt/homebrew/include/QtGui/qbitmap.h:30:49: error: cannot initialize object parameter of type 'QPixmap' with an expression of type 'QBitmap'
   30 |     inline void swap(QBitmap &other) { QPixmap::swap(other); } // prevent QBitmap<->QPixmap swaps
      |                                                 ^~~~
/opt/homebrew/include/QtGui/qbitmap.h:33:27: error: no matching member function for call to 'fill'
   33 |     inline void clear() { fill(Qt::color0); }
      |                           ^~~~
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:94:10: note: candidate function not viable: no known conversion from 'QBitmap' to 'QPixmap' for object argument
   94 |     void fill(const QColor &fillColor = Qt::white);
      |          ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:97:10: note: candidate function not viable: requires 2 arguments, but 1 was provided
   97 |     void fill(const QPaintDevice *device, const QPoint &ofs);
      |          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:99:10: note: candidate function not viable: requires 3 arguments, but 1 was provided
   99 |     void fill(const QPaintDevice *device, int xofs, int yofs);
      |          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc:32:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh:43:
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtCore.framework/Headers/qobject.h:266:43: error: no template named 'QSlotObject' in namespace 'QtPrivate'
  266 |                            new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
      |                                ~~~~~~~~~~~^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtCore.framework/Headers/qobject.h:305:43: error: no template named 'QStaticSlotObject' in namespace 'QtPrivate'
  305 |                            new QtPrivate::QStaticSlotObject<Func2,
      |                                ~~~~~~~~~~~^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtCore.framework/Headers/qobject.h:344:43: error: no template named 'QFunctorSlotObject' in namespace 'QtPrivate'
  344 |                            new QtPrivate::QFunctorSlotObject<Func2, SlotArgumentCount,
      |                                ~~~~~~~~~~~^
10 errors generated.
make[2]: *** [source/CMakeFiles/G4OpenGL.dir/build.make:317: source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLImmediateQt.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc:32:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh:45:
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:134:31: error: unknown type name 'QMatrix'
  134 |     QPixmap transformed(const QMatrix &, Qt::TransformationMode mode = Qt::FastTransformation) const;
      |                               ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:136:12: error: unknown type name 'QMatrix'
  136 |     static QMatrix trueMatrix(const QMatrix &m, int w, int h);
      |            ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:136:37: error: unknown type name 'QMatrix'
  136 |     static QMatrix trueMatrix(const QMatrix &m, int w, int h);
      |                                     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:193:5: error: unknown type name 'Q_DUMMY_COMPARISON_OPERATOR'
  193 |     Q_DUMMY_COMPARISON_OPERATOR(QPixmap)
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:193:41: error: expected ';' at end of declaration list
  193 |     Q_DUMMY_COMPARISON_OPERATOR(QPixmap)
      |                                         ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc:32:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh:36:
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh:57:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/QOpenGLWidget:1:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qopenglwidget.h:47:
In file included from /opt/homebrew/include/QtWidgets/QWidget:1:
In file included from /opt/homebrew/include/QtWidgets/qwidget.h:22:
In file included from /opt/homebrew/include/QtGui/qcursor.h:10:
/opt/homebrew/include/QtGui/qbitmap.h:30:49: error: cannot initialize object parameter of type 'QPixmap' with an expression of type 'QBitmap'
   30 |     inline void swap(QBitmap &other) { QPixmap::swap(other); } // prevent QBitmap<->QPixmap swaps
      |                                                 ^~~~
/opt/homebrew/include/QtGui/qbitmap.h:33:27: error: no matching member function for call to 'fill'
   33 |     inline void clear() { fill(Qt::color0); }
      |                           ^~~~
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:94:10: note: candidate function not viable: no known conversion from 'QBitmap' to 'QPixmap' for object argument
   94 |     void fill(const QColor &fillColor = Qt::white);
      |          ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:97:10: note: candidate function not viable: requires 2 arguments, but 1 was provided
   97 |     void fill(const QPaintDevice *device, const QPoint &ofs);
      |          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtGui.framework/Headers/qpixmap.h:99:10: note: candidate function not viable: requires 3 arguments, but 1 was provided
   99 |     void fill(const QPaintDevice *device, int xofs, int yofs);
      |          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 98%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsQGSP_BIC.cc.o
[ 98%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsQGSP_BIC_HP.cc.o
10 errors generated.
make[2]: *** [source/CMakeFiles/G4OpenGL.dir/build.make:331: source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc.o] Error 1
[ 98%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsQGSP_FTFP_BERT.cc.o
[ 98%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsINCLXX.cc.o
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:129:5: error: unknown type name 'QT6_VIRTUAL'
  129 |     QT6_VIRTUAL int indexOf(QLayoutItem *) const;
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:5: error: unknown type name 'QT6_VIRTUAL'
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:28: error: expected ';' at end of declaration list
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                            ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:163:41: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
  163 |     static void activateRecursiveHelper(QLayoutItem *item);
      |                                         ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:173:
/opt/homebrew/include/QtWidgets/qboxlayout.h:41:18: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   41 |     void addItem(QLayoutItem *) override;
      |                  ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:173:
/opt/homebrew/include/QtWidgets/qboxlayout.h:48:32: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   48 |     void insertItem(int index, QLayoutItem *);
      |                                ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:173:
/opt/homebrew/include/QtWidgets/qboxlayout.h:50:25: error: only virtual member functions can be marked 'override'
   50 |     int spacing() const override;
      |                         ^
/opt/homebrew/include/QtWidgets/qboxlayout.h:51:34: error: only virtual member functions can be marked 'override'
   51 |     void setSpacing(int spacing) override;
      |                                  ^
/opt/homebrew/include/QtWidgets/qboxlayout.h:68:5: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   68 |     QLayoutItem *itemAt(int) const override;
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:173:
/opt/homebrew/include/QtWidgets/qboxlayout.h:69:5: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   69 |     QLayoutItem *takeAt(int) override;
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:174:
/opt/homebrew/include/QtWidgets/qgridlayout.h:39:34: error: only virtual member functions can be marked 'override'
   39 |     void setSpacing(int spacing) override;
      |                                  ^
/opt/homebrew/include/QtWidgets/qgridlayout.h:40:25: error: only virtual member functions can be marked 'override'
   40 |     int spacing() const override;
      |                         ^
/opt/homebrew/include/QtWidgets/qgridlayout.h:73:5: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   73 |     QLayoutItem *itemAt(int index) const override;
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:174:
/opt/homebrew/include/QtWidgets/qgridlayout.h:74:5: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   74 |     QLayoutItem *itemAtPosition(int row, int column) const;
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:174:
/opt/homebrew/include/QtWidgets/qgridlayout.h:75:5: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   75 |     QLayoutItem *takeAt(int index) override;
      |     ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:174:
/opt/homebrew/include/QtWidgets/qgridlayout.h:79:18: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   79 |     void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = Qt::Alignment());
      |                  ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:174:
/opt/homebrew/include/QtWidgets/qgridlayout.h:85:18: error: must use 'class' tag to refer to type 'QLayoutItem' in this scope
   85 |     void addItem(QLayoutItem *) override;
      |                  ^
/opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:134:17: note: class 'QLayoutItem' is hidden by a non-type declaration of 'QLayoutItem' here
  134 |     QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to,
      |                 ^
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:38:
In file included from /opt/homebrew/Cellar/qt@5/5.15.16/lib/QtWidgets.framework/Headers/qlayout.h:174:
/opt/homebrew/include/QtWidgets/qgridlayout.h:64:50: error: cannot initialize object parameter of type 'QLayout' with an expression of type 'QGridLayout'
   64 |     inline void addWidget(QWidget *w) { QLayout::addWidget(w); }
      |                                                  ^~~~~~~~~
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc:46:
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4OpenGL_autogen/include/moc_G4OpenGLQtExportDialog.cpp:16:2: error: "This file was generated using the moc from 5.15.16. It"
   16 | #error "This file was generated using the moc from 5.15.16. It"
      |  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[ 98%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/constructors/hadron_inelastic/src/G4HadronPhysicsShielding.cc.o
make[2]: *** [source/CMakeFiles/G4OpenGL.dir/build.make:359: source/CMakeFiles/G4OpenGL.dir/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2358: source/CMakeFiles/G4OpenGL.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

and
make install

which resulted in:

[ 97%] Building CXX object source/CMakeFiles/G4ToolsSG.dir/visualization/ToolsSG/src/G4ToolsSGQtGLESViewer.cc.o
In file included from /Users/edwardt/Documents/Geant4/geant4-v11.2.2/source/visualization/ToolsSG/src/G4ToolsSGQtGLESViewer.cc:28:
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:16:2: error: "This file was generated using the moc from 5.15.16. It"
   16 | #error "This file was generated using the moc from 5.15.16. It"
      |  ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:17:2: error: "cannot be used with the include files from this version of Qt."
   17 | #error "cannot be used with the include files from this version of Qt."
      |  ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:18:2: error: "(The moc has changed too much.)"
   18 | #error "(The moc has changed too much.)"
      |  ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:35:1: error: use of undeclared identifier 'Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET'
   35 | QT_MOC_LITERAL(0, 0, 26), // "G4ToolsSGQtDestroyCallback"
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:29:5: note: expanded from macro 'QT_MOC_LITERAL'
   29 |     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
      |     ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:36:1: error: use of undeclared identifier 'Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET'
   36 | QT_MOC_LITERAL(1, 27, 7), // "execute"
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:29:5: note: expanded from macro 'QT_MOC_LITERAL'
   29 |     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
      |     ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:37:1: error: use of undeclared identifier 'Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET'
   37 | QT_MOC_LITERAL(2, 35, 0) // ""
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:29:5: note: expanded from macro 'QT_MOC_LITERAL'
   29 |     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
      |     ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:79:1: error: unknown type name 'QT_INIT_METAOBJECT'
   79 | QT_INIT_METAOBJECT const QMetaObject G4ToolsSGQtDestroyCallback::staticMetaObject = { {
      | ^
/Users/edwardt/Documents/Geant4/geant4-v11.2.2-build/source/G4ToolsSG_autogen/include/moc_G4ToolsSGQtGLESViewer.cpp:79:37: error: expected ';' after top level declarator
   79 | QT_INIT_METAOBJECT const QMetaObject G4ToolsSGQtDestroyCallback::staticMetaObject = { {
      |                                     ^
8 errors generated.
make[2]: *** [source/CMakeFiles/G4ToolsSG.dir/build.make:149: source/CMakeFiles/G4ToolsSG.dir/visualization/ToolsSG/src/G4ToolsSGQtGLESViewer.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2310: source/CMakeFiles/G4ToolsSG.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

is this a problem with qt5? - I remember there was an issue about this - I assume I have to do: Errors while building geant4 with qt5 - #6 by bmorgan

doing

edwardt@onc-0986 geant4-v11.2.2-build % ccmake -S ../geant4-v11.2.2
 QT_DIR                           /opt/homebrew/Cellar/qt@5/5.15.16/lib/cmake/Qt5                                                                                                                                                                                              
... (ran out of characters to give the rest) ...                                                                                                                                                                                 
 Qt5_DIR                          /opt/homebrew/Cellar/qt@5/5.15.16/lib/cmake/Qt5  

IIRC, these type of messages are a symptom of having the Homebrew formulae for qt (which is Qt6) and qt@5 installed. The former is linked by default into the main /opt/homebrew “view” and usually appears before other paths etc in compile/link commands.

If you do have the qt formulae installed, then you can either brew unlink it, or better, reconfigure as you did, but force use of Qt6:

cmake -DCMAKE_INSTALL_PREFIX=/Users/edwardt/Documents/Geant4/geant4-v11.2.2-install /Users/edwardt/Documents/Geant4/geant4-v11.2.2 -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_QT_QT6=ON

It’s also best if you set GEANT4_USE_OPENGL_X11 to OFF as this may not work well together with Qt6. Whilst Qt6 support in 11.2.2 is “experimental” it works well for most applications and use cases, and will cause less problems in build setups on macOS with Homebrew.

Thank for your very useful and timely advice and tips. All is working well with these steps for qt6, and is greatly appreciated. Have a good week!

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