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

前端 未结 3 1896
情书的邮戳
情书的邮戳 2020-12-04 13:40

So, I\'ve found some other clang error\'s on here that appear to be somewhat similar, however, the fixes aren\'t applicable to my situation.

I\'m using OSX Mavericks

相关标签:
3条回答
  • 2020-12-04 14:02

    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!

    0 讨论(0)
  • 2020-12-04 14:10

    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

    0 讨论(0)
  • 2020-12-04 14:11
    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"
    
    0 讨论(0)
提交回复
热议问题