ROOT version 6: root-config --incdir and --libs has changed

_ROOT Version: 6.12.06
_Platform: Ubuntu 18
Compiler: Not Provided

I used to put this in my Makefile (for code that is using ROOT include files and libraries):
ROOTLIBS = $(shell root-config --libs)
ROOTINCDIR = $(shell root-config --incdir)
$ROOTLIBS and $ROOTINCDIR would point to the paths where the include files and libs were installed and I could use them as flags for the compiler in Makefile. This would work with ROOT version 5.34

However, with ROOT version 6.12,
$ root-config --incdir points to rootbuild/include
$ root-config --libs points to points to -Lrootbuild/lib

For clearity: I don’t have a rootbuild directory.
Of course, I get I can link the correct paths to a local “rootbuild” directory, but that seems a bit clumsy…

So what is the best thing to do?



If you installed ROOT with make install, then root-config --incdir should point to the correct place. If you just copied over the build directory, then it will be broken and point to the original build directory where you first compiled ROOT. I recommend configuring with -DCMAKE_INSTALL_PREFIX=/path/to/installation then using make install to install ROOT.

Okay… This is going to be a problem because my root installation is part of another package which is not easy to install and I am a bit hesitant to re-do it. I will have to think about this.
In any case, thank you for your answer, I will think about how I will go ahead.

Hi Machiel,

Where did you get your ROOT 6.12 from, which exact file did you download or did you build it yourself?


Hi Axel,

It’s all done automatically, by a lot of scripts that install ROOT, Geant, some other stuff and GAMOS ( . I don’t want to touch the scripts nor re-compile ROOT because I am happy I got it all compiled.
However, I have made some scripts that put the ROOTLIBS and ROOTINC environment variables correctly and which I then can use in my Makefile, so I found a satisfying way around it.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.