[ROOT] PyROOT link stage

From: Elias Athanasopoulos (elathan@phys.uoa.gr)
Date: Mon May 03 2004 - 03:02:44 MEST

Dear all,

I tried to run the PyROOT demos, but:

elathan@velka:/usr/local/share/doc/root/tutorials> python demo.py 
Traceback (most recent call last):
File "demo.py", line 11, in ?
import ROOT
File "/usr/local/lib/root/ROOT.py", line 26, in ?
from libPyROOT import * 
ImportError: /usr/local/lib/root/libPyROOT.so: undefined symbol: _ZNK7TObject7DoErrorEiPKcS1_Pc

It seems that libPyROOT.so is not linked against the ROOT libraries.

elathan@velka:/usr/local/lib/root> ldd libPyROOT.so 
    libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x400ef000)
    libm.so.6 => /lib/libm.so.6 (0x401a8000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x401ca000)
    libc.so.6 => /lib/libc.so.6 (0x401d2000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
I modified the linking stage using root-config:

elathan@velka:/opt/root/root> g++ -shared -Wl,-soname,libPyROOT.so -O -o lib/libPyROOT.so pyroot/src/ConstructorDispatcher.o pyroot/src/MemoryRegulator.o pyroot/src/MethodDispatcher.o pyroot/src/MethodHolder.o pyroot/src/ObjectHolder.o pyroot/src/PyBufferFactory.o pyroot/src/RootModule.o pyroot/src/RootWrapper.o pyroot/src/TPython.o pyroot/src/Utility.o pyroot/src/G__PyROOT.o /usr/lib/python2.2/config/libpython2.2.a `root-config --libs`

Then, I copied the new libPyROOT.so to ROOT's installation directory
and I was able to run the demos without problems.

Is libPyROOT.so intentionaly not linked with ROOT libs? 

I may be wrong on this, but using the current ROOT's Makefiles you
can have access to PyROOT only via CINT's interactive mode (i.e. load
libPyROOT.so after CINT has loaded all the other needed ROOT libs).

University of Athens			I bet the human brain 
Physics Department				is a kludge --Marvin Minsky 


This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET