0

I've installed graph-tool via Mac Ports. Some days ago, I ran

$ sudo port selfupdate
$ sudo port upgrade outdated

Graph-tool was compiled anew (which took around 30 hours(!)) Now, when I want to include graph-tool in python I get the following error:

Python 2.7.6 (default, Nov 22 2013, 13:39:24) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import graph_tool
dyld: lazy symbol binding failed: Symbol not found: __ZN5boost6python7objects23register_dynamic_id_auxENS0_9type_infoEPFNSt3__14pairIPvS2_EES5_E
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so
  Expected in: flat namespace

dyld: Symbol not found: __ZN5boost6python7objects23register_dynamic_id_auxENS0_9type_infoEPFNSt3__14pairIPvS2_EES5_E
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so
  Expected in: flat namespace

Trace/BPT trap: 5

I tested the version and variant of the boost package with "port installed | grep boost": Result:

  boost @1.49.0_0+python27
  boost @1.53.0_1+no_single+no_static+python27
  boost @1.53.0_2+no_single+no_static+python27
  boost @1.54.0_0+no_single+no_static+python27
  boost @1.55.0_1+no_single+no_static+python27
  boost @1.55.0_2+no_single+no_static+python27 (active)

For graph-tool itself, the result of "port installed | grep graph-tool" is:

  py27-graph-tool @2.2.25_0
  py27-graph-tool @2.2.29_0
  py27-graph-tool @2.2.29.1_0 (active)

This is the result when I check to which libraries the one that that appears in the error message is linked:

$ otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so:
    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
    /opt/local/lib/libboost_iostreams-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /opt/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /opt/local/lib/libboost_regex-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /opt/local/lib/libCGAL.10.dylib (compatibility version 10.0.0, current version 10.0.2)
    /opt/local/lib/libexpat.1.dylib (compatibility version 8.0.0, current version 8.0.0)
    /opt/local/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.6)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)

Does anybody have an idea?

Thanks,

Thomas

EdChum
  • 376,765
  • 198
  • 813
  • 562
Thomasillo
  • 76
  • 3
  • In this [post](http://stackoverflow.com/questions/22244642/macports-python-on-mac-os-x-mavericks-fatal-python-error-pythreadstate-get?rq=1), it was suggested to do `$ otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python`. – Thomasillo Apr 08 '14 at 20:53
  • The result of that was: `/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.19.0)` – Thomasillo Apr 08 '14 at 20:56
  • What is the compiler by default on your setup? Have you possibly upgraded the OS, and did not re-install Xcode and the developer tools? That is a major caveat when using MacPorts, and I see on `otool` output that the shared object is linked against the C++ standard library of the system. – logc Apr 09 '14 at 09:03
  • The compiler Macports uses should be clang. I have never changed the settings of Macports. I'm updating Xcode at the moment and will recompile python and boost. – Thomasillo Apr 09 '14 at 14:06
  • Recompiling python, boost and graph-tool did not help. I still get the same error.By calling `nm -a /opt/local/lib/libboost_python-mt.dylib` I found that the symbol `__ZN5boost6python7objects23register_dynamic_id_auxENS0_9type_infoEPFNSt3__14pairIPvS2_EES5_E` is indeed not contained there. Nevertheless, there is a very similar symbol: `__ZN5boost6python7objects23register_dynamic_id_auxENS0_9type_infoEPFSt4pairIPvS2_ES4_E` if this means anything. – Thomasillo Apr 10 '14 at 07:02
  • I also looked for that symbol in older versions of boost, yielding the same result. – Thomasillo Apr 10 '14 at 07:05

1 Answers1

0

The issue has been solved. The latest version of graph-tool assumes Mavericks (10.9.) and uses the libc++ which causes trouble because in MountainLion the standard version of MacPorts links against libstdc++. As a result symbols are mixed up.

I installed Mavericks, installed all ports anew and now it works!

So long,

Thomas

Thomasillo
  • 76
  • 3