Python and C++ code calling ROOT

From: Marc de Kamps <dekamps_at_comp.leeds.ac.uk>
Date: Tue, 15 Jul 2008 18:59:55 +0100


Hi,  

As I mentioned last week I have C++ code which calls ROOT. Using SWIG I create a Python module. The idea is that from Python I can call my C++ routines, which call ROOT.  

This turns out to be problematic. I have to link against a library which is linked against the core ROOT libraries (root-config -libs). Python then crashes on importing my SWIG generated libraries.

>>> import Dynamic

dlopen error: /usr/not-backed-up/root/lib/root/libGX11.so: undefined symbol: _ZNK7TObject7DoErrorEiPKcS1_Pc

Load Error: Failed to load Dynamic link library /usr/not-backed-up/root/lib/root/libGX11.so

Error in <TCint::AutoLoad>: failure loading library libGX11.so for class TGX11 Error in <TPluginHandler::SetupCallEnv>: class TGX11 not found in plugin GX11  

Followed by a core dump. Apparently autoload is called but fails. Is there anything I can do about this?  

Repeating the same exercise with root-config -glibs has the same result.  

If I don't link my libraries against ROOT I get:

Python 2.5 (r25:51908, Apr 10 2007, 10:29:13)

[GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import Dynamic

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "Dynamic.py", line 7, in <module>

    import _Dynamic

ImportError: /tmp/code/build/libs/DynamicLib/libmiinddynamic.so: undefined symbol: _ZN10TCanvasImp11ShowMembersER16TMemberInspectorPc

>>>

(which seems reasonable)  

I use root 5.19/02 on FEDORA Linux  

I have also tried to load libCore.so directly into Python using LoadLibrary. This does not work because it complains about a missing symbol in libCint.so. If I try to load libCInt it complains about a missing symbol in libCore.so ..      

-

Dr. Marc de Kamps

Biosystems Group

School of Computing

University of Leeds

LS29JT, Leeds, UK  

dekamps_at_comp.leeds.ac.uk

http:/www.comp.leeds.ac.uk/dekamps   Received on Tue Jul 15 2008 - 20:01:16 CEST

This archive was generated by hypermail 2.2.0 : Tue Jul 15 2008 - 23:50:02 CEST