Home | News | Documentation | Download

Warning in <TInterpreter::ReadRootmapFile>

ROOT version: 6.xx
platform: centos7
compiler: g++

I created small libraries based on ROOT, including a dictionary for ROOT (created with rootcling).
I have been doing that for quite a while, but I am now experiencing a strange problem

  • at program execution runtime, I receive a warning that some classes of the 2nd library are already in the first one
  • this appears with a dummy program, linked with my libraries, just creating a TFile

the warning looks like

Warning in TInterpreter::ReadRootmapFile: class RExtremaFinder found in libRAnalysis.so is already in libRBase.so

I scanned my first library with nm -C, and there is absolutely no trace of the classes in the first library (here libRBase.so) !
There is also nothing about this class in the “.rootmap” file generated by rootcling.

This is the case for some of the classes created in the second library, but not all of them…
Despite they are created the same way with respect to ROOT.

I removed the .rootmap files (for both libraries) from the libraries directory, and there is no warning at execution anymore.

But I wonder if there’s something I am doing wrong… (and that may have an influence that I do not see in using my libraries)

Additional information:

  • these classes existed in a previous version of my libraries
  • I add issues with template classes (that changed in the new libraries), with an extremely long runtime warning:

Warning in TInterpreter::LoadLibraryMap: Problems in (null) declaring 'namespace std { }namespace ROOT { }namespace ROOT { namespace Math { } […VERY LONG LIST OF CLASSES AND OTHER…] ’ were encountered.

In this warning, there are classes from old libraries, or from other personal libraries that I do not use in the problem mentioned.
So it seems to me that some old stuff remain, related to TInterpreter.
But I suppose this should be impossible ?

Thank you for helping.

I found the reason of the problems, but I would be interested in an explanation of the reason.

My situation was the following:

  • I defined previously som libraries (let’s call them libA and libB) compiled with ROOT (with dictionary generation)
  • then I created a new version of these libraries… with same names, but several differences

There are no problem at compilation time, but the warnings can be triggered at run time, for example by simply creating a TFile (my interpretation is that this will trig something with the TInterpreter class… to be confirmed).

The problem comes from the fact that the old libraries still exist

  1. a class (with same name, for example MyClass) that was previously declared in libA is now declared in libB
  2. some templates that were previously declared (ex.: template < class T > class MyTemp) are redefined in the new libraries as template < class T, class Q > class MyTemp

The point 1 generates the following warning

Warning in TInterpreter::ReadRootmapFile: class MyClass found in libB.so is already in libA.so

The point 2 generates the following warning

input_line_16:1:8276: error: too many template parameters in template redeclaration
input_line_16:1:7787: note: previous template declaration is here
[…]
Warning in TInterpreter::LoadLibraryMap: Problems in (null) declaring ‘namespace std { }namespace ROOT { }namespace ROOT { namespace Math { } }namespace ROOT { namespace Math { class IParametricGradFunctionOneDim; } }namespace ROOT
[…]
;template class MyTemp; …’ were encountered.

This can be solved easily:

  • by removing the old libraries
  • or by removing the old libraries path from LD_LIBRARY_PATH

My question is: how can this happen while in the new version of my libraries (and the test program), there is absolutely no reference, no link, no include or whatever to the old libraries !!!

How/why does TInterpreter keep track of the old stuff ?

ROOT scans for *.rootmap files in all folders on the LD_LIBRARY_PATH (including the current folder). Then, at startup, it loads the rootmap file and builds a mapping between class name and the corresponding library. I suspect that you had the new and the old rootmaps which caused that warning. Good job in finding that subtle behavior on your own!

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