PyROOT on OSX10.9 in v5-34-patches

Hi,

Sorry for yet another PyROOT in OSX 10.9 question, but I couldn’t see my particular issue in any of the other threads. I’m using ROOT v5-34-17-107-g0ad6203 which I compile using cmake:

The compilation goes fine, but when I try and import ROOT in python I get:

[code]Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT
Traceback (most recent call last):
File “”, line 1, in
File “/Users/nedwards/Software/root/builds/v5-34-17-107-g0ad6203/lib/ROOT.py”, line 103, in
import libPyROOT as _root
ImportError: dlopen(/Users/nedwards/Software/root/builds/v5-34-17-107-g0ad6203/lib/libPyROOT.so, 2): Symbol not found: __ZN13TStreamerInfo14WriteBufferAuxIPPcEEiR7TBufferRKT_iiii
Referenced from: /Users/nedwards/Software/root/builds/v5-34-17-107-g0ad6203/lib/libTree.so
Expected in: flat namespace
in /Users/nedwards/Software/root/builds/v5-34-17-107-g0ad6203/lib/libTree.so[/code]

It looks like cmake is picking up the same python version and libraries as what I am trying to use, so I don’t think that is the issue. Any ideas?

Thanks,

Nick

Nick,

that is not to do with different version of python, as the missing symbol is in libTree.so (which is loaded b/c libPyROOT.so is linked with it). Do you have any old ROOT releases sitting around?

Alternatively, there may be an issue with load order. Could you check (“otool -L libPyROOT.so” I believe), if libPyROOT.so is linked with libRIO.so (which should contain that symbol)? If not, whether libTree.so is linked with it (it should)?

Cheers,
Wim

Hi Wim,

Thanks for the fast reply! I do have other ROTO versions installed, but I’m not sure that is the issue as my LD_LIBRARY_PATH / DYLD_LIBRARY_PATH /LIBPATH all point to the current ROOT version. Also, I was able to compile 5-34-19 using an identical procedure (but in a different directory) and PyROOT loads fine (but I have other unrelated problems with that version).

I checked, and libPyROOT.so is indeed linked against libRIO.so:

@c160147 v5-34-17-107-g0ad6203$ otool -L /Users/nedwards/Software/root/builds/v5-34-17-107-g0ad6203/lib/libPyROOT.so /Users/nedwards/Software/root/builds/v5-34-17-107-g0ad6203/lib/libPyROOT.so: @rpath/libPyROOT.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libRIO.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libNet.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libHist.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libGraf.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libGraf3d.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libGpad.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libTree.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libMatrix.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libThread.so (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5) @rpath/libMathCore.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libCint.so (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

Nick

Nick,

but does libTree.so also link with libRIO.so? Also, can you verify (with ‘nm -D libRIO.so | grep _ZN13TStreamerInfo14WriteBufferAuxIPPcEEiR7TBufferRKT_iiii’ for example) that libRIO contains the needed symbol?

Cheers,
Wim

Hi Wim,

Sorry I forgot to say, yes libTree also links to libRIO.so. libRIO.so does contain that symbol. So it all looks fine. Strange also that with a similar compile/setup procedure, 5-34-18/19 works fine, but then I get “Cannot bind ROOT object w/o class” when I try and access TTree branches in PyROOT…

Thanks for your help,

Nick

Nick,

[quote=“nick_ed”]yes libTree also links to libRIO.so. libRIO.so does contain that symbol.[/quote]beats me then … Only thing (assuming that LD_LIBRARY_PATH is really correct and the libraries have not moved (rpath pbs)), is that there’s a missing -Wl,-flat_namespace during linking.

[quote=“nick_ed”]I get “Cannot bind ROOT object w/o class” when I try and access TTree branches in PyROOT…[/quote]Means that the class (i.e. the dictionary) for the object in the branch is not available. Either missing rootmap file (for the auto-loader), or the shared library that contains it can not be loader (not available on LD_LIBRARY_PATH, or also missing symbols).

Cheers,
Wim

Hi Wim,

Yeah I’m stuck too. In the end I decided to just use the later version of ROOT and work round the other problems.

Right, that’s what I thought. But these are primitive float / int branches, so shouldn’t need any special dictionaries? In the end I worked around by doing:

            myFloatBranch = array( 'f', [0])
            tree.SetBranchStatus( "myFloatBranch", 1 )
            tree.SetBranchAddress( "myFloatBranch", myFloatBranch )
....
            tree.GetEntry(i)
            myFloat = myFloatBranch[0]

which works fine, but is a bit of a pain…