Hi folks,
I’m working in ROOT 5.34/00 on Ubuntu 11.10. I have built a library of functions that, not surprisingly, relies on ROOT functions. Attempts to load my library in CINT fail because the ROOT libraries are not auto-loaded. If I manually load the required ROOT libraries, my library works as expected. I do not see this problem in ROOT 5.32 on Scientific Linux 5.7. Details on both systems and symptoms are below. Suggestions are very welcomed!
James
First, the machine on which the libraries do not load correctly:
> uname -a
Linux dmatter-OptiPlex-GX620 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 i686 i686 i386 GNU/Linux
> root-config --version
5.34/00
> root -l
root [0] gDebug=6
(const int)6
Tab-completion shows that the location of the ROOT libraries is known
root [2] gSystem->Load("libGraf
libGraf3d.so
libGraf.rootmap
libGraf3d.rootmap
libGraf.so
But when I load my library that depends on the ROOT libraries, the ROOT libraries are not autoloaded, I get an error message (and no indication that auto-loading of ROOT libraries was attempted):
root [1] gSystem->Load("libMaxCam.so");
dlopen error: /home/dmatter/dmtpc/projects/DarkMatter/MaxCam/libMaxCam.so: undefined symbol: _ZTI6TGraph
Load Error: Failed to load Dynamic link library /home/dmatter/dmtpc/projects/DarkMatter/MaxCam/libMaxCam.so
Info in <TUnixSystem::Load>: loaded library /home/dmatter/dmtpc/projects/DarkMatter/MaxCam/libMaxCam.so, status -1
Next up, a configuration that does work. Scientific Linux 5.7, ROOT 5.32/00 (and the debug messages show that the ROOT libraries are auto-loaded…
> uname -a
Linux noether.lns.mit.edu 2.6.18-308.8.2.el5 #1 SMP Tue Jun 12 11:25:25 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
> root-config --version
5.32/00
> root -l
root [0] gDebug = 6
(const int)6
root [1] gSystem->Load("libMaxCam.so");
Info in <TCint::AutoLoadCallback>: loaded dependent library libMathCore.so for class TGeoVolumeAssembly
...
Info in <TCint::AutoLoad>: loaded library libGX11TTF.so for class TGX11TTF
Selected visual 0x21: depth 24, class 4, colormap: default
Is there a difference in the AutoLoading in 5.34? Do I need to explicitly activate this? Note, that if I manually load the required ROOT libraries, the my libMaxCam.so loads successfully:
> root -l
root [0] gSystem->Load("libGraf.so");
root [1] gSystem->Load("libPhysics.so");
root [2] gSystem->Load("libTree.so");
root [3] gSystem->Load("libMinuit.so");
root [4] gSystem->Load("libMaxCam.so");
And tab-completion recognizes the functions in my library:
root [5] MaxCamImage
MaxCamImageTools::BLUR_EDGE_BEHAVIOR
MaxCamImageTools::BILATERAL_VALUE_FN
MaxCamImageTools::GRADIENT_OPERATOR
MaxCamImageTools::ANISOTROPIC_DIFFUSION_FN
MaxCamImageTools::ELLIPSE_PARAMETERS
MaxCamImage
MaxCamImageTools
root [5] MaxCamImage
Apologies if this is a trivial problem, but I could not find a fix in the documentation.
Oh, also, when creating libMaxCam.so I do link to the required ROOT libraries (as suggested in
root.cern.ch/root/roottalk/roottalk01/1895.html):
> g++ -shared -O2 -m32 -L/usr/lib/root -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf <...truncated...> -o libMaxCam.so
and (for example), libGraf.so is in /usr/lib/root
> ls /usr/lib/root/libGraf.so
/usr/lib/root/libGraf.so*