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(https://github.com/giglio0/DRAGON-G4-LaBr3.git) 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
CMake.

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/libexpat.so (found suitable version “2.2.9”, minimum required is “2.2.9”)
– Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
– Found X11: /usr/include
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - 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/libXm.so
– Configuring done
– Generating done
CMake Warning:
Manually-specified variables were not used by the project:

GEANT4_DIR

– 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/LaBr3_v4.cc.o
[ 18%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/DetectorConstruction.cc.o
[ 27%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/DetectorMessenger.cc.o
[ 36%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/EventAction.cc.o
[ 45%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/HistoManager.cc.o
/home/cancan/Gatev9/example_Geant4/LaBr/LaBr3/src/HistoManager.cc:29:10: 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/HistoManager.cc.o] 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 https://github.com/giglio0/DRAGON-G4-LaBr3.git 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
{PROJECT_SOURCE_DIR}/src/DetectorConstruction.cc {PROJECT_SOURCE_DIR}/src/DetectorMessenger.cc
{PROJECT_SOURCE_DIR}/src/EventAction.cc {PROJECT_SOURCE_DIR}/src/PhysicsList.cc
{PROJECT_SOURCE_DIR}/src/PrimaryGeneratorAction.cc {PROJECT_SOURCE_DIR}/src/RunAction.cc
{PROJECT_SOURCE_DIR}/src/SteppingAction.cc {PROJECT_SOURCE_DIR}/src/TrackingAction.cc)

this list has not included the HistoManager.cc. i thought that maybe i added the [${PROJECT_SOURCE_DIR}/src/HistoManager.cc], 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: