Hi
ROOT: v6-09-01-626-g492b0f6 (master)
gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)
When building a shared library with a ROOT(Cling) dictionary generated using rootcling
rootcling automatically adds any “-I” directives to a list of include paths which are stored in e.g. G__MyClass.cxx as:
namespace {
void TriggerDictionaryInitialization_G__MyClass_Impl() {
static const char* headers[] = {
"MyClass1.h",
0
};
static const char* includePaths[] = {
"/home/john/work/ROOT/debug/rootcling_includepaths/build/../src",
"/home/john/software/build/root-master/include",
"/home/john/work/ROOT/debug/rootcling_includepaths/build/",
0
};
In this example, the first path was given to a rootcling “-I” directive, the second is $ROOTSYS/include, and the third is the build directory where rootcling was run: this was not given to any “-I” directive, but it seems to be systematically added automatically. These paths are then added automatically to gSystem->GetIncludePath() when the library is loaded in the interpreter, and are used by ACliC for any on-the-fly compilation.
My problem is: using rootcling option “-noIncludePaths” I can remove the dependency on the source directory given to “-I”, then at runtime I set ROOT_INCLUDE_PATH to point to the installation directory with my .h. However, the spurious working directory/build directory include path always remains, option “-excludePath” does nothing to remove it, and as the build directory is a kind of network file system disk which is not necessarily mounted at runtime, any attempt to use ACliC after loading the library fails, with errors from cc1plus that the directory in question does not exist.
I need a runtime environment which only depends on the installed libraries/files/etc., not on any source files or temporary build files/directories: indeed, one would expect everything to work even if source & build directories are completely removed from the system. This is not the case.
How can I do either of:
(1) stop rootcling automatically adding the directory where it is run to the stored list of include paths in the dictionary?
or
(2) stop the interpreter automatically adding the include paths stored in the dictionary when the library is loaded?
Thanks a lot for any help