Macxcode5.1 install Mysql-python compilation exception Solution

Source: Internet
Author: User
Macxcode5.1 install Mysql-python the macbookair that was entered a few days before the compilation error was solved. xcode and command_line_tools installed in appstore are all in the latest version. As a result, I am stuck and the compilation tool is too new and incompatible, an error occurs. Clang: error: unknownargument:-mno-fused-madd [-Wunused

Macxcode5.1 install Mysql-python the compilation error is solved a few days before the macbook air is entered, xcode and command_line_tools installed in app store are the latest version, the result is I am stuck, the compilation tool is too new, incompatible. An error occurs. Clang: error: unknown argument: '-mno-fused-madd' [-Wunused-c

Mac xcode5.1 install Mysql-python compilation error Solution

The macbooks air installed a few days ago is the latest version of xcode and command_line_tools installed in the app store. As a result, I am stuck and the compilation tool is too new, incompatible, and incorrect.

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]


I downloaded mysql-python-1.2.4b4.tar.gz from mysql-python.sourceforge.net.

Shell cmd:

Tar-cjf MySQL-python-1.2.4b4.tar.gz

Cd MySQL-python-1.2.4b4

Python setup. py build

The following error code is displayed:

build/lib.macosx-10.9-intel-2.7/MySQLdb running build_ext building '_mysql' extensioncc -fno-strict-aliasing -fno-common -dynamic -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 -pipe -Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]clang: note: this will be a hard error (cannot be downgraded to a warning) in the futureerror: command 'cc' failed with exit status 1

Let's talk about the problem analysis process. I started to analyze the code in setup. py and wanted to find the compilation option-mno-fused-madd. Then I deleted it, but I couldn't find it for a long time,

I found that python calls the setuptools module. I went to the code of this module and found that it was an egg package. I couldn't check its source code.


Finally, I couldn't help it. I thought it should be the reason why my compilation tool is too new.

Final Solution:

I found the dmg package of command_line_tools in xcode5.0.2 and earlier versions on the Internet.

Uninstall xcode5.1 and install the two packages. The problem is solved !!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.