Geant4 compling error of a repo

Dear user,

i am just a beginner user on Geant4. i have to tried LaBr3 code via after the configuration while creating build files with make command, the process send a error message.

Scanning dependencies of target LaBr3_v4
[ 9%] Building CXX object CMakeFiles/LaBr3_v4.dir/
[ 18%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/
[ 27%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/
[ 36%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/
[ 45%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/
/home/cancan/Gatev9/example_Geant4/LaBr/LaBr3/src/ fatal error: TH1D.h: No such file or directory
29 | #include <TH1D.h>
| ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/LaBr3_v4.dir/build.make:134: CMakeFiles/LaBr3_v4.dir/src/] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/LaBr3_v4.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

in the begining i thought it was about root libraries so that i re-install the root with use “-Dall=ON”. i hoped it could be fix the error but couldn’d. After that, i checked the Cmakelist of the repo but like i said before i coundn’t see file list of the sources. maybe you thing i am silly but i said before i am just beginer so i added source directory of among of source list in cmakelist.txt file. Of course it wasn’t also work.

list(APPEND sources

Can anbody help me?

We don’t know the G4 build system that well. Maybe calling source wherever/your/ROOT/is/bin/ before running cmake on the G4 build will fix this? Else please check with the Geant forum!

you are right and i also shared my error with Geant forum. accually i created this topic because i wanted to learn that if i want to install all libraries of root, is it enough add [-Dall=ON] to continue the cmake command when i configurate the the root.

I think this is likely due to changes to ROOT’s ROOTConfig.cmake file (the repo in question is 4yrs old). The error:

is pointing to the include directory(ies) for ROOT not being added to the build. See the ROOT docs here:

and check that the correct CMake variables/target are being used in the project’s CMakeLists.txt.

1 Like