Error in running exampleB1 (Ubuntu, geant4-v11.0.2)

Hello everyone. Hope you are doing well.

I have recently got to know about the Geant4 simulation software. I have some error showing up while trying running the exampleB1 to check if my installation of the software has been done right or not.
While i make the " cmake … " command, it shows an error as below:

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.

I would like to tell that I have installed Geant4 at: /home/mukul/software1/geant4/geant4-v11.0.2-install
I also attach the screenshot of it. As I’m new to this, can anyone please help me fix this, so that i can run the exampleB1.
Thanks.

1 Like

visit the directory named as /home/mukul/software1/geant4/geant4-v11.0.2-install/bin now here, you should do source geant4.sh and now head back to your example B1 dir and run cmake . or sudo cmake .

Thank you for the reply.
I did as you told, but the error still persist as shown below.

For your reference, i below list all the files present inside the build directory of the example B1.

Looking forward to your reply.

You need to pass the directory in which you installed Geant4 to CMake through the CMAKE_PREFIX_PATH variable, e.g.:

$ cmake -DCMAKE_PREFIX_PATH=/home/mukul/software1/geant4/geant4-v11.0.2-install <otherargs>

CMake should then be able to pick up your install of Geant4.

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