简体   繁体   English

MacPorts图形工具安装的链接器问题

[英]Linker trouble with MacPorts installation of graph-tool

I've installed graph-tool via Mac Ports. 我已经通过Mac Ports安装了graph-tool。 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: 重新编译了Graph工具(耗时约30个小时(!))现在,当我想在python中包含Graph工具时,出现以下错误:

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: 我使用“安装了端口| grep boost”测试了boost软件包的版本和变体:结果:

  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: 对于graph-tool本身,“安装端口| grep graph-tool”的结果是:

  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 汤玛士

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++. 最新版的graph-tool假定使用Mavericks(10.9。),并使用libc ++,这会引起麻烦,因为在MountainLion中,MacPorts的标准版本链接到libstdc ++。 As a result symbols are mixed up. 结果,符号混合在一起。

I installed Mavericks, installed all ports anew and now it works! 我安装了Mavericks,重新安装了所有端口,现在可以使用了!

So long, 太长,

Thomas 汤玛士

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM