Compiler seems to not see Root?

Hello everyone!
I am trying to install a data analysis software for some gamma spectrometry (DSAM lifetime analysis), namely APCAD (tried to put the link to it on ScienceDirect, apparently I am not allowed to).

I have managed to convince APCAD itself to work, but another included and needed program, StopSim, is currently eluding my attempts to properly compile.

I have Root 6.26 installed, as well as Geant4 (the other dependency), and am following the instructions (which are just to do cmake and make in a build folder).

However, when trying to make, it throws up a series of errors as if it’s not seeing Root properly

In file included from /home/lucian/APCADStopSim/StopSim_1.0/include/StopSimDetectorConstruction.hh:31,
                 from /home/lucian/APCADStopSim/StopSim_1.0/StopSim.cc:40:
/home/lucian/APCADStopSim/StopSim_1.0/include/StopSimHisto.hh:45:10: fatal error: TDirectory.h: No such file or directory
   45 | #include "TDirectory.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/StopSim.dir/build.make:76: CMakeFiles/StopSim.dir/StopSim.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/StopSim.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I would be very grateful for some assistance and let me know what bits of code I should post.
All the best,
Stan


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: 6.26/10
Platform: Linux Mint 5.15.0-131-generic
Compiler: c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0


Hello,

Thanks for the post. This seems an issue with the build system of APCAD. Did you check that the compiler invocation command has all the correct directories listed, e.g. for finding the include files?

Cheers,
D

Hello Danilo,
Thank you for your reply and apologies for the late reply.
I have tried to figure it out, but I haven’t managed to find the issue. The CMakeCache file seems to indicate to me that it does see Root correctly, but it is not compiling.
I am uploading the files relating to CMake, I am surely missing something.
CMakeLists.txt (2.0 KB)
GNUmakefile.txt (517 Bytes)
CMakeCache.txt (20.1 KB)
Makefile.txt (29.6 KB)
cmake_install.cmake.txt (2.6 KB)
Many thanks and I appreciate your time,
Stan

Hi,

What was the compiler invocation that caused the error to appear?

Best,
D

I just called ‘make -j4’ after doing a cmake in a new build folder.

Hi,

Thanks! But what was the compiler invocation that generated the error and how the include paths look?

Cheers,
Danilo

Hello Danilo,
I have troubleshot it now with a colleague, and we managed to find the issue. I wasn’t including all the paths correctly in my bashrc.
Namely, I was missing:
export CPLUS_INCLUDE_PATH=$ROOTSYS/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=$ROOTSYS/lib:$LIBRARY_PATH

Adding these solved the issue.
All the best!

Hi,

Thanks for sharing the solution! Indeed at the end the include path…
My advice would be to add that include path with -I switches to the compiler invocation rather than at environment level. That setting risks silently to affect in undesired ways compilation of other programs - but glad it works for you!

Cheers,
D