Jay
Jay

Reputation: 433

clang: error: unknown argument: '-mno-fused-madd'

When installing ReportLab 3.1.8, I ran into the problem where I kept getting the error and I could not find where this compiler option was being set.

The point in setup was:

building 'reportlab.lib._rl_accel' extension

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 future error: command 'cc' failed with exit status 1

Upvotes: 0

Views: 1067

Answers (2)

gambl
gambl

Reputation: 1

You can still repress these errors from clang by using the following environment variables:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

A detailed answer to a similar question can be found here:

clang error: unknown argument: '-mno-fused-madd' (python package installation failure)

According to the following the issue has also been fixed in OS X 10.9.3:

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

Upvotes: 0

Jay
Jay

Reputation: 433

Here is my solution.

Cause: I keep my mac up to date and as a result it seems I now have a newer (different) version of the c compiler (clang) than the one that allowed the "-mno-fused-madd" command line switch.

Solution: I did not find the above switch in any file in the reportlab source. It had to be on the computer itself. The culprit seemed to be in the distutils, because setup.py uses module distutils.

The problem was in the file /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py. This file contains definitions as a dictionary named build_time_vars. We are obviously in the right place as we have a build time problem.

  1. First make a copy as a safeguard.
  2. sudo <editor> <file path> to edit the file.
  3. Then editing this file, search for and remove the switch -mno-fused-madd from the file. I found it in line beginning with 'CFLAGS' since this is a compile flag. Change the line:

... -fwrapv -mno-fused-madd -DENABLE_DTRACE ... to ... -fwrapv -DENABLE_DTRACE ...

Save the file and continue with your build. It will now stay fixed. No need for environment variables or any such thing.

Edit: While you are at it, remove both _sysconfigdata.pyc and _sysconfigdata.pyo files.

Upvotes: 1

Related Questions