How to Resolve the \'clang: error: unknown argument: \'-mno-fused-madd\'\' Error During psycopg2 Installation?

Mary-Kate Olsen
Release: 2024-11-20 22:02:14
Original
847 people have browsed it

How to Resolve the

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]
Copy after login

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
Copy after login

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
Copy after login

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template