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

大城市里の小女人 提交于 2019-11-27 17:37:51
tino

I ran into the same problem recently while trying to install a different package.

Setting the following environment variables prior to installing with pip resolved the issue for me:

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

If you're installing via sudo, don't forget to use "sudo -E" so that your environment variables propagate through sudo.

If that doesn't work for you, try the following command instead:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install ansible

Alternatively, as yet another potential solution, you can attempt to recompile a fresh version of python using Homebrew.

See this question for more information.

Hope this helps!

Brendan Falkowski

For the beginners, who read and tried the answer above but still failed (me):

sudo su - export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments pip install ansible exit

You need to run those export commands as the root user. The previous answer clearly states this, but what it actually meant didn't translate to me as a terminal novice. What sudo su - does is basically switch to the root user. Then any commands you type are executed as root, and this thing works.

This finally let me get Ansible running on OSX 10.9.2 after a lot of head-banging.

Solution reference: https://github.com/ansible/ansible/issues/7146#issuecomment-41239561

fbs
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future cc .....

or

export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!