添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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:

Screenshot from 2022-06-16 13-28-28 1169×386 60.3 KB

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.

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

Screenshot from 2022-06-19 12-17-381100×569 129 KB

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

Screenshot from 2022-06-19 12-19-321110×136 42.5 KB

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.