[Solved-5 Solutions] clang error unknown argument mno fused madd python package installation failure



Error Description:

We 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] 
click below button to copy the code. By - python tutorial - team

Solution 1:

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 
click below button to copy the code. By - python tutorial - team

Then pip install psycopg2 should work.

Solution 2:

  • 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.

Solution 3:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2 
click below button to copy the code. By - python tutorial - team

Solution 4:

That involves removing the flag from the python installation.

  • In /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyare several places where the -mfused-madd / -mno-fused-madd flag is set.
  • Edit this file and remove all of the references to that flag your compilation should work:
sudo sed -i '.old''s/ -m\(no-\)\{0,1\}fused-madd //g' /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py 
click below button to copy the code. By - python tutorial - team

You need to delete the corresponding _sysconfigdata.pyc and _sysconfigdata.pyo files as well - at least on my system these files did not automatically get rebuilt:

cd /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
sudo rm _sysconfigdata.pyo _sysconfigdata.pyc 
click below button to copy the code. By - python tutorial - team

Note that you have to use root access to make those changes.

Solution 5:

  • Switch the python binaries.

You can do this via sudo:

  • cp /usr/bin/python /usr/bin/python_orig
  • ln -s /usr/local/Cellar/python/2.7.6/bin/python /usr/bin/python

Then, 'brew install rdiff-backup' succeeds without any errors.

Finally, do "mv /usr/bin/python_orig /usr/bin/python" to revert everything back.


Related Searches to clang error unknown argument mno fused madd python package installation failure