【问题标题】:Biopython installation on MacOSX El Capitan, gcc error -Qunused-arguments在 MacOSX El Capitan 上安装 Biopython,gcc 错误 -Qunused-arguments
【发布时间】:2016-08-08 22:03:42
【问题描述】:

我正在尝试安装 Biopython,但收到此错误:

> gdr$ python setup.py build running build running build_py running
> build_ext building 'Bio.cpairwise2' extension gcc -DNDEBUG -g -fwrapv
> -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/Applications/Canopy.app/appdata/canopy-1.7.2.3327.macosx-x86_64/Canopy.app/Contents/include/python2.7
> -c Bio/cpairwise2module.c -o build/temp.macosx-10.6-x86_64-2.7/Bio/cpairwise2module.o gcc: error:
> unrecognized command line option ‘-Qunused-arguments’ gcc: error:
> unrecognized command line option ‘-Qunused-arguments’ error: command
> 'gcc' failed with exit status 1

我正在运行 MacOSX El Capitan 10.11.3,gcc 版本 4.9.2 20141029(预发布)。 似乎没有其他人在 stackoverflow 和 google 上报告过这个问题(快速搜索)。

(更新)解决方案:

我解决了编辑setup.py安装文件中的os_clang_fix(),评论:

#    for flag in ["CFLAGS", "CPPFLAGS"]:
#        if flag not in os.environ:
#            os.environ[flag] = "-Qunused-arguments"
#        elif "-Qunused-arguments" not in os.environ[flag]:
#            os.environ[flag] += " -Qunused-arguments"

【问题讨论】:

    标签: macos biopython


    【解决方案1】:

    这是一个 clang 特定选项,据我所知,它在 gcc 中不可用。

    来自clang手册页:

       -Qunused-arguments
           Don't emit warning for unused driver arguments.
    

    你有[至少]两个选项来解决这个问题:

    • 删除项目构建文件周围所有出现的Qunused-arguments(我不太推荐这个)。
    • 安装clang(只需在终端上运行clang并按照安装说明进行操作即可)。

    另外[个人意见提前],如果您出于任何特定原因不需要gcc,请将其卸载,并将clang 保留在您的OSX 上,这似乎是Apple 的意愿:)。

    【讨论】:

    • 好建议:它让我走上了正轨。谢谢你 pah :)。
    猜你喜欢
    • 1970-01-01
    • 2016-01-29
    • 1970-01-01
    • 1970-01-01
    • 2016-03-11
    • 2018-06-19
    • 2016-04-11
    • 2017-09-18
    • 1970-01-01
    相关资源
    最近更新 更多