Looking at the instructions here https://geant4-userdoc.web.cern.ch/Doxygen/examples_doc/html/README_HowToRun.html When I attempt to follow these instructions, the build fails. First. I build and install Geant4 using the following commands. cmake -DCMAKE_INSTALL_PREFIX=/home/mattb/Geant4/install -DGEANT4_INSTALL_DATA=ON -DGEANT4_INSTALL_DATADIR=/home/mattb/Geant4/data -DGEANT4_BUILD_MULTITHREADED=ON .. -GNinja ninja ninja install and this works correctly to build install the code, and the examples. Now I try to build the example Just starting with the first example in /home/mattb/Geant4/install/share/Geant4/examples/basic/B1 mattb@0cb28a7-lcedt:~/Geant4/install/share/Geant4/examples/basic/B1$ mkdir build mattb@0cb28a7-lcedt:~/Geant4/install/share/Geant4/examples/basic/B1$ cd build mattb@0cb28a7-lcedt:~/Geant4/install/share/Geant4/examples/basic/B1/build$ cmake -DGeant4_DIR=/home/mattb/Geant4/install/lib/Geant4-11.1.2/ .. -- The C compiler identification is GNU 11.4.0 -- The CXX compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /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: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:13 (find_package): By not providing "FindGeant4.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Geant4", but CMake did not find one. Could not find a package configuration file provided by "Geant4" with any of the following names: Geant4Config.cmake geant4-config.cmake Add the installation prefix of "Geant4" to CMAKE_PREFIX_PATH or set "Geant4_DIR" to a directory containing one of the above files. If "Geant4" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/mattb/Geant4/install/share/Geant4/examples/basic/B1/build/CMakeFiles/CMakeOutput.log". These files exist but not in the expected location. Attempting using make also fails. All the examples seem to have this issue.
Hello, Thank you for reporting this. The location of the cmake files in Geant4 installation has changed in Geant4 11.1, see the Relese Notes (https://geant4.web.cern.ch/download/release-notes/notes-v11.1.0.html): 3. Items for migration of the user code ... - Using standard install location for CMake find_package configuration files under $CMAKE_INSTALL_PREFIX/lib/cmake/Geant4. - Application builds using CMake will need to set Geant4_DIR to this new location, or use CMAKE_PREFIX_PATH, to find Geant4. Please, use mattb@0cb28a7-lcedt:~/Geant4/install/share/Geant4/examples/basic/B1/build$ cmake -DGeant4_DIR=/home/mattb/Geant4/install/lib/cmake/Geant4/ .. We will fix this information in the examples documentation.
The documentation is fixed now.