Installation: cmake can not find load file: Geant4MacroLibraryTargets

Hello,

I’m facing an installation error. Does someone had a similar problem and can help?
Thank you.

João

My software:
Geant4 version: 10.05.p01
OS: Ubuntu 20.4
gcc version 9.3.0

Problem:
I’m getting an error when running cmake:
include could not find load file: Geant4MacroLibraryTargets

If I give the complete path to the file, this error is solved but a similar one appears for a macro inside this file (include could not find load file: G4DeveloperAPI).

Last note: the error appears even without any flag option.

Command
$ cmake -DCMAKE_INSTALL_PREFIX=/home/joao/Software/Geant4/geant4-install -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_INSTALL_DATA=ON-DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_SYSTEM_CLHEP=ON -DCLHEP_INCLUDE_DIR=/home/joao/Software/CLHEP/2.4.1.3/CLHEP-install/include/ -DCLHEP_LIBRARY=/home/joao/Software/CLHEP/2.4.1.3/CLHEP-install/lib/libCLHEP.so -DGEANT4_INSTALL_EXAMPLES=ON /home/joao/Downloads/Geant4/geant4.10.05.p01/source

Output:
– The C compiler identification is GNU 9.3.0
– The CXX compiler identification is GNU 9.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done

CMake Error at analysis/CMakeLists.txt:35 (include):

include could not find load file:
Geant4MacroLibraryTargets

CMake Error at analysis/CMakeLists.txt:51 (GEANT4_GLOBAL_LIBRARY_TARGET):
Unknown CMake command “GEANT4_GLOBAL_LIBRARY_TARGET”.

I found the problem: I was using as the source directory geant4.10.XX.XX/source instead of only geant4.10.XX.XX

Solved

I am getting same error though I am using /home/user/Downloads/Geant4/geant4.10.05.p01/

anyone can help?

Hi, palSumanta.
Just in case: if you remove the “/” in the end of the source directory path, anything changes?
Like this: /home/user/Downloads/Geant4/geant4.10.05.p01