Root_generate_dictionaries and rootcling always hard-code the names of the headers in the dictionaries

While doing some experiments I noticed that root_generate_dictionaries tries to always pass the absolute header paths to rootcling. This hard-codes the paths of the headers in the source tree inside the dictionary, so that when opening the dictionary at runtime the headers are searched in the source tree. This can lead to runtime errors when the source tree is not available, and makes it impossible to use ROOT_INCLUDE_PATH even when the -noIncludePath flag has been passed to rootcling. How can I make root_generate_dictionaries produce dictionaries using the exact header paths I passed to it? Thanks.

ROOT Version: 6.14.04
Platform: Archlinux
Compiler: GCC 8.2.1

Yes indeed! I’ve just fixed this in master for ROOT.

In general the procedure is: pass headers as #included and provide the relevant -I for rootcling to find the headers.

Cheers, Axel

Thanks Axel for quickly dealing with my issue. Which are the next tagged versions that will incorporate the fix? Also, is this a regression so that there is the possibility to rollback to a working version of Root until a fixed version is shipped?

Edit: if I’m correct you fixed the issue in commit f102e78, right? If yes then I’d say you did a tachionic bug fix, fixing a bug before it has been even reported! :laughing:

I’d prefer not to backport this as it breaks existing user code. I hope for a good reason - I honestly don’t know how to fix this in a backward compatible way.

This will be part of v6.18 expected to be released in May. There will be an RC1 release around begin April.

Cheers, Axel.

Ok, I was not asking for a backport but simply whether this “feature” has always been in Root or if it was introduced at a certain point. In my opinion this fixes a wrong behavior which invalidated also part of the documentation (i.e. the usage of ROOT_INCLUDE_PATH) so I believe it is worth the breakage it introduces in old code.
Thanks again.

1 Like

Hi ROOT community!

Nice Forum! I just wanted to open a new topic for my question, but then the forum was suggesting me this thread. I think Axels fix will solve my issue, thank you very much!

Here is the question I wanted to ask originally and that is not so relevant now:

Over the weekend, I ported the CMS signal extraction tool “Higgs Combine” to a standalone package that can be used outside the CMS environment, that can be installed as easy as a python package and gets automatically validated with unit tests on Travis:

I don’t know where this project is going, so far it was a fun exercise :smiley:

There is just one n00b question I have about ROOT dictionary generation. I do this with one line in CMake [1], and it works like a charm. However, when I want to delete the repository after installing the package, I get the following error when I try to import it:

Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for /home/jonas/combine/include/combine/classes.h
requested to autoload type

Now that’s not so bad, one can just keep the repo directory after installing, but if you install a package with pip, the source files will be first copied to some temporary directory which is removed afterwards.

Is there a way to generate dictionaries that don’t depend on the header files staying where they are, or change the header file locations a posteriori? Basically I have a problem because the header file paths are hardcoded into the dictionary at build time, but obviously the idea is to move them later at the install stage. I hope I phrased my issue well enough such that it can be understood :slight_smile:

Cheers and thank you very much for your help,


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