8

Whenever I compile Cython code (using pyximport) and frequently when I install packages from source (with pip) I get

clang: warning: argument unused during compilation: '-mno-fused-madd'

What is this warning and what can I do to prevent it? I suspect I may not be able to prevent when pip triggers it, but is thre at least some way to configure pyximport to avoid it?


OS X 10.9, Python 2.7.5, Xcode clang 500.2.79

orome
  • 45,163
  • 57
  • 202
  • 418

2 Answers2

7

The answer before didn't work for me, but it worked this to tell clang to ignore these error messages:

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

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

Community
  • 1
  • 1
Jose Luis de la Rosa
  • 696
  • 1
  • 10
  • 14
  • 1
    Thanks! This almost worked for me. If you are installing with `sudo` command you need to use the `-E` flag. See http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa – kalu Apr 26 '14 at 04:39
4

-mno-fused-madd is a gcc cpu target option. It is for enabling/disabling the generation of the fused multiply/add instructions (FMACs. Common in DSPs).

Since this is gcc-specific, clang gives a warning that it doesn't understand the option.

If you really don't want to see this warning you could try setting the default compiler by

env CC=/usr/bin/gcc pip install ...

This should also work for pyximport too (But I haven't tried).

kamjagin
  • 3,614
  • 1
  • 22
  • 24
  • So, basically an innocuous warning that I can just learn to not let bother me. If I've built my whole python stack with `clang` rather than `gcc`, would "switching" like this create any problems? – orome Nov 30 '13 at 01:56
  • 1
    Shouldn't be any problems with switching, clang and gcc are ABI compatible so no problem there (unless you manually specify to use the new stdlib libc++ in which case the compatibility is only partial) – kamjagin Nov 30 '13 at 09:59