web-dev-qa-db-ja.com

Ansibleインストール-clang:エラー:不明な引数: '-mno-fused-madd'

そのため、多少似ているように見える他のclangエラーがここにいくつか見つかりましたが、修正は私の状況に適用できません。

私はOSX Mavericksを使用しており、Ansibleをインストールしようとしています。正しくインストールするためにpipを取得しましたが、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

これを手伝ってくれる人に感謝します。これをインストールするために過去数時間を費やしてきましたが、かなりイライラし始めています。

23
CreationTribe

別のパッケージをインストールしようとしたときに、最近同じ問題に遭遇しました。

Pipでインストールする前に次の環境変数を設定すると、問題が解決しました。

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

Sudo経由でインストールする場合は、環境変数がSudoを介して伝播されるように、「Sudo -E」を使用することを忘れないでください。

それでもうまくいかない場合は、代わりに次のコマンドを試してください。

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

あるいは、さらに別の潜在的な解決策として、Homebrewを使用してpythonの新しいバージョンを再コンパイルすることを試みることができます。

詳細は この質問 を参照してください。

お役に立てれば!

67
tino

上記の answer を読んで試したが、まだ失敗した初心者の場合(私):

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

これらのexportコマンドをrootユーザーとして実行する必要があります。以前の答えはこれを明確に述べていますが、それが実際に意味したことはターミナル初心者として私に翻訳されませんでした。何 Sudo su -は基本的にrootユーザーに切り替えます。次に、入力したコマンドはすべてrootとして実行され、これが機能します。

これにより、多くのヘッドバンギングの後、OSX 10.9.2でAnsibleを実行できるようになりました。

ソリューションリファレンス: https://github.com/ansible/ansible/issues/7146#issuecomment-41239561

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

または

export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
3
fbs