Include path at runtime with CLING

Dear Rooters,
my (not_so_small) application HistPresent used to work under ROOT5 - anywhere.
With ROOT6 (Cling) it builds but runs only in its installation directory.
In other directories I get the following sort of errors (many many):

[code]input_line_42:23:10: fatal error: ‘gredit/inc/ChangeTextDialog.h’ file not found
#include “gredit/inc/ChangeTextDialog.h”
^
Error in TInterpreter::AutoParse: Error parsing payload code for class GrCanvas with content:

#include “gredit/inc/TSplineX.h”
#include “gredit/inc/XGrabDialog.h”

#undef _BACKWARD_BACKWARD_WARNING_H

Error in TClass::LoadClassInfo: no interpreter information for class GrCanvas is available eventhough it has a TClass initialization routine.
[/code]
Obviously something is wrong with the INCLUDE PATHs in the Makefile for ROOT6/Cling.

Thanks in advance for a hint.
Otto

Hallo Otto,

to fix this issue and be able to run your application from anywhere, you need to set the ROOT_INCLUDE_PATH variable to the location of the headers which are included. The “syntax” used in presence of multiple paths is analogous to the one of LD_LIBRARY_PATH.
In your case, the variable should be set to the path of the directory containing the “gredit” directory.

Cheers,
Danilo

Dear Rooters,

good news is: Setting ROOT_INCLUDE_PATH works.
I first had to change the Makefile (to be precise:Module.mk) in such a way that
the paths of the .h files given to rootcling at build time are available during execution
time. This was not the case before.

Still I have 2 questions:

On my laptop (same enviroment as on our Linux cluster R 6.04.06, U 14.01.03) it worked
always in any directory without setting ROOT_INCLUDE_PATH :
Where does root (cling) look at runtime for the include files other than in CWD?

How can rootcling be instructed at build time to store only the basename of an
include file in G__XXX.cxx.
E.g. in ROOTs hist/hist/Module.mk I see:

with

i.e the full pathnames

In src/G__Hist.cxx

// Header files passed as explicit arguments #include "Foption.h" #include "HFitInterface.h" #include "TAxis.h"
i.e. only the basenames

Cheers
Otto

Hi Otto,

That is correct: these headers are parsed at runtime by ROOT to acquire information about the interfaces of the classes in the libraries. When Clang pre compiled modules will be in an appropriate shape, this limitation might be lifted. Presently, there is a way not to install, or rather to implicitly do it, the headers given as arguments to rootcling, i.e. to use the “-inlineInputHeader” flag (see rootcling -h for more information).

Now, the questions:

The system includes, e.g. /usr/include, and $ROOTSYS/include.

By specifying the include path with “-I/path/to/header”. For example, this is how this is done in ROOT.

Cheers,
Danilo