Ansible安装-clang:错误:未知参数:' - mno-fused-madd'

Cre*_*ibe 23 gcc ansible osx-mavericks

所以,我发现其他一些铿锵错误似乎有些类似,但是,修复不适用于我的情况.

我正在使用OSX Mavericks,我们正在尝试安装Ansible.我有点正确安装,但是当我尝试安装Ansible时,我得到了这个clang错误.我们首先想到它可能是一个版本问题,所以我在使用gcc49遇到同样的错误后重新安装了gcc46,但我仍然遇到错误.

有谁知道如何解决这一问题?

来自pip.log日志文件的完整错误报告如下:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -Wall -Wstrict-prototypes -Wshorten-64-to-32 -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.9-intel-2.7/src/MD2.o

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

----------------------------------------
Cleaning up...
  Removing temporary dir /private/tmp/pip_build_root...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto
Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 706, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto
Run Code Online (Sandbox Code Playgroud)

感谢任何可以帮助我的人.我们花了几个小时试图安装它,它开始变得相当令人沮丧.

tin*_*ino 67

我最近在尝试安装不同的软件包时遇到了同样的问题.

在使用pip安装之前设置以下环境变量解决了我的问题:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Run Code Online (Sandbox Code Playgroud)

如果您通过sudo进行安装,请不要忘记使用"sudo -E",以便您的环境变量通过sudo传播.

如果这对您不起作用,请尝试以下命令:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install ansible
Run Code Online (Sandbox Code Playgroud)

或者,作为另一种可能的解决方案,您可以尝试使用Homebrew重新编译新版本的python.

有关更多信息,请参阅此问题.

希望这可以帮助!

  • 如果它仍然无法使用sudo -E pip安装pycrypto设置变量后,-E部分是神奇的! (5认同)

Bre*_*ski 6

对于初学者,他们阅读并尝试了上面的答案,但仍然失败了(我):

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

您需要以exportroot用户身份运行这些命令.之前的回答清楚地说明了这一点,但它的实际意义并没有转化为我作为终端新手.什么sudo su -基本上切换到root用户.然后,您键入的任何命令都以root身份执行,这一点可行.

这最终让我在经过大量的轰炸之后,让OSX在OSX 10.9.2上运行.

解决方案参考:https://github.com/ansible/ansible/issues/7146#issuecomment-41239561