在Mac OS X(10.7)上安装图形工具 - 已经安装了Boost,但不断出现此错误

dmo*_*oly 5 c++ python macos boost install

我一直坚持这个问题一段时间了.我正在尝试安装图形工具 - http://graph-tool.skewed.de/download#macos - 我有以下步骤的先决条件,图表工具网站链接到:https:// gist .github.com/openp2pdesign/8864593

而不是brew安装,这似乎没有给我所有的文件,我去了Boost的官方网站,并从那里正确下载,遵循这些步骤:http://www.boost.org/doc/libs/1_41_0/more /getting_started/unix-variants.html它主要是获取tar文件并解压缩它.

然后我把我的boost安装在这里:

/usr/local/boost_1_55_0
Run Code Online (Sandbox Code Playgroud)

我做了一个小的C++示例并确认了Boost的工作原理(使用http://www.boost.org/doc/libs/1_41_0/more/getting_started/unix-variants.html中的 "使用Boost构建简单程序").

现在问题的关键:尝试安装图形工具.在最后一步,我做到了

./configure PYTHON_EXTRA_LDFLAGS="-L/usr/local/bin"
Run Code Online (Sandbox Code Playgroud)

(PYTHON_EXTRA_LDFLAGS =" - L/usr/local/bin"只是让配置脚本找到Python好了.)

但是我得到了这个错误.(它发现Python很好,但没有提升!)

...
================
Detecting python
================
checking for a Python interpreter with version >= 2.6... python
checking for python... /Users/daze/Library/Enthought/Canopy_64bit/User/bin/python
checking for python version... 2.7
checking for python platform... darwin
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for python2.7... (cached) /Users/daze/Library/Enthought/Canopy_64bit/User/bin/python
checking for a version of Python >= '2.1.0'... yes
checking for a version of Python == '2.7.3'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/include/python2.7
checking for Python library path... -L/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/config -lpython2.7
checking for Python site-packages path... /Users/daze/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages
checking python extra libraries...  -ldl  -framework CoreFoundation
checking python extra linking flags... -L/usr/local/bin
checking consistency of all components of python development environment... yes
graph-tool will be installed at: /Users/daze/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages
===========================
Using python version: 2.7.3
===========================
    checking for boostlib >= 1.38.0... configure: error: We could not detect the boost 
libraries (version 1.38 or higher). If you have a staged boost library (still not installed) 
please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  
If you are sure you have boost installed, then check your version number looking in 
<boost/version.hpp>. See http://randspringer.de/boost for more documentation.
Run Code Online (Sandbox Code Playgroud)

尝试2:然后我尝试正确设置BOOST_ROOT:

在我的〜/ .bash_profile中:

export BOOST_ROOT="/usr/local/boost_1_55_0"
Run Code Online (Sandbox Code Playgroud)

但它仍然没有好处,所以我解开了.

尝试3:然后我尝试明确指定boost的安装位置:

./configure --with-boost="/usr/local/boost_1_55_0" PYTHON_EXTRA_LDFLAGS="-L/usr/local/bin"
Run Code Online (Sandbox Code Playgroud)

但它仍然无法找到提升,并在"我们无法检测到升级库(版本1.38或更高版本)"的结尾产生同样的错误.

这一直困扰着我.我仔细阅读,并到randspringer.de/boost现场,看到这个在FAQ - http://www.randspringer.de/boost/faq.html#id2514912:

问:我不明白配置错误消息

在配置时,我得到:

检查boostlib> = 1.33 ... configure:错误:我们无法检测到boost库(版本1.33或更高版本).如果你有一个分阶段的升级库(仍然没有安装),请在你的环境中指定$ BOOST_ROOT,不要给--with-boost选项提供PATH.如果您确定已安装增强版,请检查您的版本号.有关更多文档,请参见http://randspringer.de/boost.

我不知道我是否使用了阶段性版本的boost.它是什么,我该怎么办?

答:如果您没有自己编译Boost,则没有分阶段版本,您不必设置BOOST_ROOT.在这里查看不同类型安装的说明.

如果您确定已安装Boost,请使用指定目录

./configure --with-boost = your-boost-directory.

如果仍然无效,请检查boost/version.hpp中的版本号,并将其与configure.ac中请求的版本进行比较.

在比较版本号时我不知道该看什么.那里没有我觉得有趣的东西.

希望有人至少知道采取何种其他方法.

小智 1

我认为您当前将 --with-boost 指向 boost 父目录,而不是 boost 库。尝试

./configure --with-boost="/usr/local/boost_1_55_0/libs/"  PYTHON_EXTRA_LDFLAGS="-L/usr/local/bin"
Run Code Online (Sandbox Code Playgroud)