clang错误:未知参数:'-mno-fused-madd'(python包安装失败) [英] clang error: unknown argument: '-mno-fused-madd' (python package installation failure)

查看:408
本文介绍了clang错误:未知参数:'-mno-fused-madd'(python包安装失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图通过pip在小牛10.9上安装 psycopg2 时出现以下错误:

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

不知道如何继续和在这里和别处搜索此特定错误。



以下是pip的完整输出:

  $ pip install psycopg2 
下载/解压psycopg2
下载psycopg2-2.5.2.tar.gz(685kB):下载685kB
运行setup.py(路径:/ private / var /folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2/setup.py)package psycopg2的egg_info

安装收集的软件包:psycopg2
为psycopg2运行setup.py install
build 'psycopg2._psycopg'extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno- fuse-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 -DPSYCOPG_DEFAULT_PYDATETIME = 1 -DPSYCOPG_VERSION =2.5.2(dt dec pq3 ext)-DPG_VERSION_HEX = 0x090303 -DPSYCOPG_EXTENSIONS = 1 -DPSYCOPG_NEW_BOOLEAN = 1 -DHAVE_PQFREEMEM = 1 -I / System / Library / Frameworks / Python.framework / Versions / 2.7 / include / python2.7-I。 -I / usr / local / Cellar / postgresql / 9.3.3 / include -I / usr / local / Cellar / postgresql / 9.3.3 / include / server -c psycopg / psycopgmodule.c -o build / temp.macosx-10.9 -intel-2.7 / psycopg / psycopgmodule.o
clang:error:unknown argument:'-mno-fused-madd'[-Wunused-command-line-argument-hard-error-in-future]
clang:注意:这将是一个硬错误(不能降级到警告)在未来
错误:命令'cc'失败退出状态1
完成输出命令/ usr / bin / python -cimport setuptools,tokenize; __ file __ ='/ private / var / folders / 0z / ljjwsjmn4v9_zwm81vhxj69m0000gn / T / pip_build_tino / psycopg2 / setup.py'; exec(compile(getattr(tokenize,'open',open) ).read()。replace('\r\\\
','\\\
'),__file__,'exec'))install --record / var / folders / 0z / ljjwsjmn4v9_zwm81vhxj69m0000gn / T / pip-bnWiwB -record / install-record.txt --single-version -ternally-managed --compile:
运行install

运行构建

运行build_py

创建build

创建build / lib.macosx-10.9-intel-2.7

创建build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / __ init__.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / _json.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / _range.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / errorcodes.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / extensions.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / extras.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / pool.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / psycopg1.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

复制lib / tz.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2

创建build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制测试/ __ init__。 py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制测试/ dbapi20.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制测试/ dbapi20_tpc.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制测试/ test_async.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_bug_gc.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_bugX000.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

replication tests / test_cancel.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制tests / test_connection.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制tests / test_copy.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_cursor.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_dates.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_extras_dictcursor.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_green.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制tests / test_lobject.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制tests / test_module.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_notify.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

replication tests / test_psycopg2_dbapi20.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_quote.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_transaction.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_types_basic.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_types_extras.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

copy tests / test_with.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制tests / testconfig.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

复制测试/ testutils.py - > build / lib.macosx-10.9-intel-2.7 / psycopg2 / tests

运行build_ext

构建'psycopg2._psycopg'扩展

创建构建/temp.macosx-10.9-intel-2.7

创建build / temp.macosx-10.9-intel-2.7 / psycopg

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 -DPSYCOPG_DEFAULT_PYDATETIME = 1 -DPSYCOPG_VERSION =2.5.2(dt dec pq3 ext)-DPG_VERSION_HEX = 0x090303 - DPSYCOPG_EXTENSIONS = 1 -DPSYCOPG_NEW_BOOLEAN = 1 -DHAVE_PQFREEMEM = 1 -I / System / Library / Frameworks / Python.framework / Versions / 2.7 / include / python2.7 -I。 -I / usr / local / Cellar / postgresql / 9.3.3 / include -I / usr / local / Cellar / postgresql / 9.3.3 / include / server -c psycopg / psycopgmodule.c -o build / temp.macosx-10.9 -intel-2.7 / psycopg / psycopgmodule.o

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

clang:注意:这将是一个硬错误(不能降级为警告)在未来

错误:命令'cc'失败退出状态1

----------------------------------------
清理...
命令/ usr / bin / python -cimport setuptools,tokenize; __ file __ ='/ private / var / folders / 0z / ljjwsjmn4v9_zwm81vhxj69m0000gn / T / pip_build_tino / psycopg2 / setup.py'; exec(compile(getattr(tokenize,'open',open)(__ file __)。read()。replace('\r\\\
','\\\
'),__file__,'exec' -record /var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip-bnWiwB-record/install-record.txt --single-version -ternally-managed --compile失败,错误代码1在/ private / var / folders / 0z中/ ljjwsjmn4v9_zwm81vhxj69m0000gn / T / pip_build_tino / psycopg2


解决方案

clang通过在编译之前设置以下环境变量,不会将此错误提升为:

  export CFLAGS = -Qunused-arguments 
export CPPFLAGS = -Qunused-arguments

然后 pip install psycopg2 应该可以工作。



当尝试 pip install lxml 时, >

编辑:如果您安装为超级用户(这可能是如果你试图附加到 /Library/Python/2.7/site-packages ,原生的苹果工厂安装的Python发行版附带的OS X,而不是一些其他Python分发,你随后安装自己),那么你将需要做,如@Thijs Kuipers

  sudo -E pip install psycopg2 

或等价物,对于任何其他程序包名称,您可以替换 psycopg2



UPDATE [2014-05-16]:Apple已经修复了 OS X 10.9.3 所以当使用最新的小牛和 Xcode 5.1 + 时不再需要解决方法。但是,现在,如果你使用 Xcode,则 OS X 10.8.x (Mountain Lion,目前为10.8.5)仍然需要解决方法: 5.1 +


I get the following error when attempting to install psycopg2 via pip on Mavericks 10.9:

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

Not sure how to proceed and have searched here and elsewhere for this particular error. Any help is much appreciated!

Here is the complete output from pip:

$ pip install psycopg2
Downloading/unpacking psycopg2
  Downloading psycopg2-2.5.2.tar.gz (685kB): 685kB downloaded
  Running setup.py (path:/private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2/setup.py) egg_info for package psycopg2

Installing collected packages: psycopg2
  Running setup.py install for psycopg2
    building 'psycopg2._psycopg' extension
    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 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.2 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090303 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.3/include -I/usr/local/Cellar/postgresql/9.3.3/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.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
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip-bnWiwB-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

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

creating build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/__init__.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/_json.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/_range.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/errorcodes.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/extensions.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/extras.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/pool.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/psycopg1.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

copying lib/tz.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

creating build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/__init__.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/dbapi20.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/dbapi20_tpc.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_async.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_bug_gc.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_bugX000.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_cancel.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_connection.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_copy.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_cursor.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_dates.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_extras_dictcursor.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_green.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_lobject.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_module.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_notify.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_psycopg2_dbapi20.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_quote.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_transaction.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_types_basic.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_types_extras.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/test_with.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/testconfig.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

copying tests/testutils.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

running build_ext

building 'psycopg2._psycopg' extension

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

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

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 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.2 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090303 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.3/include -I/usr/local/Cellar/postgresql/9.3.3/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.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

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip-bnWiwB-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2

解决方案

You can tell clang to not raise this as an error by setting the following environment variables prior compilation:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Then pip install psycopg2should work.

I had the same when trying to pip install lxml.

Edit: if you are installing as superuser (which will likely be the case if you are trying to append to /Library/Python/2.7/site-packages, the native Apple factory-installed Python distribution which ships with OS X, rather than to some other Python distribution which you have subsequently installed yourself), then you will need to do, as described by @Thijs Kuipers in comments below:

sudo -E pip install psycopg2

or the equivalent, for whatever other package name you may be substituting in place of psycopg2.

UPDATE [2014-05-16]: Apple has fixed this problem with updated system Pythons (2.7, 2.6, and 2.5) in OS X 10.9.3 so the workaround is no longer necessary when using the latest Mavericks and Xcode 5.1+. However, as of now, the workaround is still required for OS X 10.8.x (Mountain Lion, currently 10.8.5) if you are using Xcode 5.1+ there.

这篇关于clang错误:未知参数:'-mno-fused-madd'(python包安装失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆