Geant4 compling error of a repository

Dear Users,

I want to talk about a compiling error. i am just beginner level user. I installed the Gean410.06 version issueless and i could compile the basic examples and i saw a repository of a LaBr3 in github via giglio( also giglio shared how to compline it with the code but i cannot compine it. The output;

make -DGEANT4_DIR=/home/cancan/Gatev9/geant4_10_06-install/lib/Geant4-10.6.3 /home/cancan/Gatev9/example_Geant4/LaBr/LaBr3
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of

Update the VERSION argument value or use a … suffix to tell
CMake that the project does not need compatibility with older versions.

– The C compiler identification is GNU 9.3.0
– The CXX compiler identification is GNU 9.3.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
– Found EXPAT: /usr/lib/x86_64-linux-gnu/ (found suitable version “2.2.9”, minimum required is “2.2.9”)
– Found OpenGL: /usr/lib/x86_64-linux-gnu/
– Found X11: /usr/include
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/;/usr/lib/x86_64-linux-gnu/
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/;/usr/lib/x86_64-linux-gnu/ - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Found Motif: /usr/lib/x86_64-linux-gnu/
– Configuring done
– Generating done
CMake Warning:
Manually-specified variables were not used by the project:


– Build files have been written to: /home/cancan/Gatev9/example_Geant4/LaBr
cancan@cancan:~/Gatev9/example_Geant4/LaBr$ make
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

Can anybody help me?

The command line is case sensitive so GEANT4_DIR is not the same as Geant4_DIR. That should get rid of the cmake warning.

For the missing include (TH1D.h), that is a ROOT file. Looking at the cmake config file of the repo it checks if you have ROOT installed. I don’t see that message in your output so I guess you do?

I don’t use ROOT so someone else will have to comment on how to make sure it’s include directories are add to the appropriate paths.

It’s probably best to contact the developers of as this is related to their CMake scripts.

you are right about [Geant4_DIR] and i fixed it but isn’t about my error. after i checked the CmakeFile.txt of the repo and i saw this directory list of sources,

list(APPEND sources

this list has not included the i thought that maybe i added the [${PROJECT_SOURCE_DIR}/src/], it could be fix. but it doesn’t work as well.

you are also right and i wrote the developers of this repo. but this repo was loaded 3 years ago and the developer hasn’t been active anymore github. accually have no hope the developer answer my question.

I’ve replied on the post of the ROOT forum as I think this is related to changes in ROOT’s cmake config file: