clang error: unknown argument: '-mno-fused-madd' (python package installation failure)

后端 未结 14 2515
攒了一身酷
攒了一身酷 2020-11-22 04:43

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

clang: error: unknown argument: \'-mno-fused-madd\' [-W         


        
14条回答
  •  一生所求
    2020-11-22 04:57

    Update: 10.9.3 resolves the issue with system CPython.

    This is caused by the latest clang update from Apple that came with Xcode 5.1 today and is affecting many, many people, so hopefully a fix will appear soon.

    Update: Did not expect this to get so much attention, but here's more detail: the clang 3.4 Apple is shipping defaults to erroring on unknown flags, but CPython builds modules using the same set of flags it was compiled with originally. The system CPython was compiled with several flags that are unknown by clang, thus causing this problem. The following are the current Mavericks (10.9.2) CPython compile flags:

    -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -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
    

    To resolve this issue you have a few options:

    • Add ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future to your compile flags.
    • Pass CFLAGS=""
    • Strip the unsupported flags from the sysconfigdata.py (as is noted in another answer).
    • Compile a new python using homebrew.
    • Wait for the next OS X update, which is rumored to include recompiled Python/Ruby to remove this issue for system runtimes.

提交回复
热议问题