【问题标题】:Install blist in mac os x Mavericks在 mac os x Mavericks 中安装 blist
【发布时间】:2014-04-24 04:46:55
【问题描述】:

当我在我的 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

【问题讨论】:

    标签: python macos clang


    【解决方案1】:

    基于 github ticket 和这个 SO answer,以下为我工作。

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

    【讨论】:

      【解决方案2】:

      我找到了解决此问题的方法。

      安装 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。

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

      【讨论】: