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

我一直坚持这个问题一段时间了.我正在尝试安装图形工具 – 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

我做了一个小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"

(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.

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

在我的〜/ .bash_profile中:

export BOOST_ROOT="/usr/local/boost_1_55_0"

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

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

./configure --with-boost="/usr/local/boost_1_55_0" PYTHON_EXTRA_LDFLAGS="-L/usr/local/bin"

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

这一直困扰着我.我仔细阅读了,然后去了randspringer.de/boost网站,在FAQ – http://www.randspringer.de/boost/faq.html#id2514912中看到了这个:

Q: I do not understand the configure error message

At configure time I get:

checking for boostlib >= 1.33… configure: error: We could not detect
the boost libraries (version 1.33 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 . See 07005 for more
documentation.

I don’t know if I use a staged version of boost. What is it and what
can I do ?

A: If you did not compile Boost by yourself you don’t have a staged
version and you don’t have to set BOOST_ROOT. Look here for an
explanation of different kind of installations.

If you are sure you have Boost installed then specify the directory
with

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

If it still does not work, please check the version number in
boost/version.hpp and compare it with the version requested in
configure.ac.

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

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

最佳答案
万岁,我第一次有机会回馈Stack Overflow!我过去两天一直在处理这个问题.

>通过Xcode升级clang
>创建一个包含版本号的符号链接

/usr/local/include/boost-1_55.0 – > ../Cellar/boost/1.55​​.0/include/boost

(包含因为我使用Brew安装了Boost并且遇到了这个问题)

>在configure中编辑CXXFLAGS的生成,使其如下所示:

old_cxxflags = “$CXXFLAGS”
CXXFLAGS =“${CXXFLAGS} -std = gnu 11 -stdlib = libc”
{$as_echo“$as_me:${as_lineno- $LINENO}:检查C编译器是否支持-std = gnu 11”>& 5
$as_echo_n“检查C编译器是否支持-std = gnu 11 …”>& 6; }
>跑

./configure –disable -sparsehash CXX =“/usr/bin/clang”PYTHON_EXTRA_LDFLAGS =“ – L /usr/local/bin”

版本

操作系统:Mac OS X 10.8.5
Clang:Apple LLVM 5.0版(clang-500.2.79)(基于LLVM 3.3svn)
目标:x86_64-apple-darwin12.5.0
线程模型:posix
图形工具:2.2.29.1
提升:1.55.0

说明

>如果您查看配置代码并尝试编译configure中生成的confdefs.h文件,则会在遇到-Wno-unused-local-typedefs标志时看到clang错误.这是“我们无法检测到增强库(版本1.33或更高版本)”错误的实际原因,而不是它无法找到增强文件的事实.更新版本的clang修复了此问题.
>版本号的配置测试很愚蠢.它期望boost include目录包含版本号.
>运行make时,您可能会遇到以下错误:

./../graph_adjacency.hh:26:10:致命错误:找不到’tuple’文件

这是由引用错误的标准库引起的[1]

./../graph_adaptor.hh:655:39: error: expected ';' in 'for' statement specifier  
    for(typeof(removed_edges.begin()) iter = removed_edges.begin();  
./../graph_adaptor.hh:655:39: error: use of undeclared identifier 'tier'  

这是由引用错误的C标准引起的(c 11而不是gnu 11)

参考

[1] No member named ‘forward’ in namespace ‘std’
[2] I’m having some trouble with C++11 in Xcode

转载注明原文:在Mac OS X(10.7)上安装图形工具 – 已经安装了Boost,但不断出现此错误 - 代码日志