clang error: Unknown Argument '-mno-fused-madd' Resolved during Package Installation
Upon attempting to install psycopg2 via pip on Mavericks 10.9, some users encounter the error:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
This issue arises during the compilation of the psycopg2 extension. To resolve it, set the following environment variables before compilation:
export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments
After setting these variables, retry pip install psycopg2 and it should succeed.
Additional Note for macOS Users
If you are installing a package as a superuser (likely to modify the factory-installed Python distribution in /Library/Python/2.7/site-packages), use:
sudo -E pip install psycopg2
This command ensures that the environment variables you have set are preserved during the sudo operation.
Fix in macOS 10.9.3 and Later
Apple has addressed this issue in system Python versions 2.7, 2.6, and 2.5 in OS X 10.9.3 and later. As a result, the aforementioned workaround is no longer necessary when using Mavericks 10.9.3 or higher with Xcode 5.1 . However, the workaround is still required for OS X 10.8.x (Mountain Lion) users with Xcode 5.1 .
The above is the detailed content of How to Resolve the \'clang: error: unknown argument: \'-mno-fused-madd\'\' Error During psycopg2 Installation?. For more information, please follow other related articles on the PHP Chinese website!