clang error: unknown argument: '-mno-fused-madd' (python package installation failure)
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 psycopg2
should 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.
pip install salt returns 'clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
Try putting the environmental variable assignment after sudo:
sudo ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" pip install gdal
Or, become root, then do the export:
sudo su -
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" install gdal
pip install ...
It appears that the sudo command does not inherit the environmental variables, and they certainly aren't saved across multiple runs with sudo:
$ export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
$ sudo printenv | grep ARCHFLAGS
$
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
It is due to a change in clang
defaults in Xcode 5.1
and Apple not noticing that it would break extension module builds using the system Python. One workaround is to define the following environment variables first:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
UPDATE [2014-05-16]: As expected, 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.
MySQLdb Clang: error: unknown argument: '-mno-fused-madd'
I found the solution, I was using XCode 5.1 and command line version 5
that's the problem, python isn't compatible with GCC 5.1 I just downloaded the old GCC version on apple site and install it, now everything is ok!
Psycopg2 Error: clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
I don't actually know the answer, but, I searched around a bit as I use all of the components you are having issues with. I ran into this:
http://kaspermunck.github.io/2014/03/fixing-clang-error/
So, you might try something like:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2
It seems the issue is that the cc command line includes arguments that don't make sense to cc, and it used to be a soft error, but now it is a fatal error. Good Luck!
-g
getting error mno-fused-madd installing kivy in virtualenv over fish shell
This is caused by an apparent bug in cython 0.22, which we haven't resolved in kivy master yet (it's not clear what's best, or whether we should fix part of the problem in cython itself). You can resolve it by using cython 0.21, or alternatively there's a pull request for a fix in kivy's github repository that you can try if you're willing to build the source manually.
I don't think it has anything to do with your using fish, that's probably just a coincidence with the cython update.
'cc' failed with exit status 1 error when install python library
Installing with (inside of the program folder you pulled down)
sudo -E python setup.py install
did the job!
Related Topics
Executable Python Program with All Dependencies for Linux
Crontab Failed to Run Python Script at Reboot
Is There Something Wrong with This Python Code, Why Does It Run So Slow Compared to Ruby
Is There a Built-In Function to Print All the Current Properties and Values of an Object
Checking If a String Can Be Converted to Float in Python
How to Profile Memory Usage in Python
Capturing Repeating Subpatterns in Python Regex
How to Get List of Values from Dict
How to Know If an Object Has an Attribute in Python
Set Bash Variable from Python Script
Usb Automatic Detection in Python for Linux Env
Does Python Do Variable Interpolation Similar to "String #{Var}" in Ruby
What Does the Slash Mean in Help() Output
Beyond Top Level Package Error in Relative Import
After Conda Update, Python Kernel Crashes When Matplotlib Is Used