Run B1 example after installing geant4

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:
Operating System:
Compiler/Version:
CMake Version:

Dear All,
I have installed Geant4 v11.3.0 on my mac pro

  1. I started by installing Cmake 3.31.3 and qt5 using Homebrew,

  2. Then I downloaded the Geant4v11.3.0 to the dowenload folder and created “Build folder”.

  3. I inserted the cmakeLists.txt test file from geant4 folder to the cmake application and build the binaries inside the “Build folder” and run the “configure”. The configuration done successfully. Where CMAKE_INSTALL_PREFIX where installed under user/local.

  4. I chose Multithread, INSTALL_DATA, USE_qt and re-configured.

  5. an error found “qt5 core directory not found”. I added it to CMAKE_PREFIX_PATH and re-configure (user/local/opt/qt@5/lib)

  6. Then “generate”

  7. again from the “Build folder” I opened new terminal and start the compilation using “make” command

  8. them “make install”.

  9. I tried to run B1 example. created build file and run “cmake …/” and I got the following error
    "CMake Error at /Applications/CMake.app/Contents/share/cmake-3.31/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
    By not providing “FindQt5Core.cmake” in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by “Qt5Core”, but
    CMake did not find one.

Could not find a package configuration file provided by “Qt5Core” with any
of the following names:

Qt5CoreConfig.cmake
qt5core-config.cmake

Add the installation prefix of “Qt5Core” to CMAKE_PREFIX_PATH or set
“Qt5Core_DIR” to a directory containing one of the above files. If
“Qt5Core” provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
/usr/local/lib/cmake/Geant4/Geant4Config.cmake:371 (find_dependency)
CMakeLists.txt:11 (find_package)"

PS.
I did not change any thing in my terminal configuration -zsh file

Hi

I don’t immediately recognise the error messages, but try this. When you install qt with homebrew, you often get both Qt5 and Qt6. brew links them in some way. To use Qt5, you have to unlink them - “brew unlink qt”.

Try that, and tell us if it fixes things.

Incidentally, Geant4 11.3 works with Qt6.

John

Hi again

On my Mac, brew puts stuff in /opt. I have

CMAKE_PREFIX_PATH=$(brew --prefix qt@5)

You can look at the path:

echo $(brew --prefix qt@5)  
/opt/homebrew/opt/qt@5

John