Make install and search for headers

Hi,

It seems I’m doing something wrong with the installation of custom ROOT libs, but I can’t se where and why.

I made a small example one can find here:

git clone https://github.com/YPatois/root_test.git
cd root_test
./test1.sh

The small test1.sh scripts do (assuming root has been configured):

  • Compile a small “unTest.so” lib b(under pwd/build), and install it (under pwd/local")
  • Run the test1.C script, that just load that lib once (it works)
  • Erase the source .h file (not the installed ones)
  • Run again test1.C and one (and only one) of the .h file is not found (it’s only looked for at source location, the other being rightly find at install location).

I don’t understand that behavior. The only thing that I could see is that the source file location is hardcoded in the pcm file, which is not very useful, as they are then installed, and may be where that incorrect patrh is taken from (but then why only for one file?).

Could someone enlighten me?

Thanks.

ROOT Version: 6.32.04
Platform: Alma9
Compiler: g++ (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)

Hi @YannickPatois,

thank you for the reproducer and explanation. Maybe @bellenot could help here?

Cheers,
Marta

No idea, but I’ll try to figure it out, or find someone who knows…

Looking at this error message:

Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for /home/ubuntu/rootdev/forum/YannickPatois/root_test/TTAB.h
   requested to autoload type TTMAB

I guess maybe @vvassilev can help?

I’m back on that topic after a year, but still no solution.
How does one compile, link and install a root based software?
I looked again in the doc, or elsewhere, I couldn’t find anything.
As one can see from my little example, “make install” is not producing a working app.
What do I miss?
Thanks.

I ping @vvassilev like @bellenot did last year.

Side note:

This will not solve your problem, but consider modernizing a bit your CMakeLists following: https://github.com/user-attachments/files/22621538/zdt.zip

or ROOT — Modern CMake

you can use target_link_libraries ROOT::MyComponent instead ${ROOT_LIBRARIES}

If you want to improve things even more, take a look at using CMake FILE_SETs

see CMake File sets (#52) · Issues · CLIUtils / Modern CMake · GitLab

then you can easily control where your header destination goes installed into.

2 Likes

Hi,
I updated my CMakeLists.txt according to the example given, and now it works!

Thanks a lot!

Yannick

PS:

  • Git code is updated (and should work)
  • Still a question: are ROOT macros not able to take care of install path and generated PCM and rootmap?
    Thanks.

Hi,

I finally found out: the ROOT macros misbehaves on GLOB() directives, but it’s clearly illustrated on the latest version of my github code.
Replacing GLOB() by the list makes it work.