在Mac OS X Mavericks上安装blist

3

当我在我的Mac(OS X Mavericks 10.9.2)上安装了blist时,我遇到了错误。

creating build/temp.macosx-10.9-intel-2.7

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DBLIST_FLOAT_RADIX_SORT=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _blist.c -o build/temp.macosx-10.9-intel-2.7/_blist.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

Clang版本:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
2个回答

1

基于 GitHub 和这个 SO 答案, 以下方法对我有用。

sudo su
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install blist

1
我发现了解决此问题的方法。
安装apple-gcc42(对于Homebrew,请使用以下命令):
$brew install apple-gcc42

然后更改 /usr/bin/cc 的符号链接。

$ls -al /usr/bin/cc
lrwxr-xr-x  1 root  wheel  5 Feb 25 11:11 cc -> clang 

使用命令。
$cd /usr/bin
$sudo ln -sf /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 cc

$ls -al /usr/bin/cc
lrwxr-xr-x  1 root  wheel  54 Mar 18 12:50 cc -> /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2

这是"/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2"路径,Homebrew安装apple-gcc42编译器包的位置。

然后安装blist。

如果您找到更好的解决方案,请发布它。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接