Installing LLVM libraries along with Xcode

前端 未结 2 1100
名媛妹妹
名媛妹妹 2020-12-25 09:01

So I just installed Xcode on my Mac and now I would like to install LLVM as well in order to play around a bit with LLVM itself. Currently the compiler can (obviously) not f

2条回答
  •  太阳男子
    2020-12-25 09:38

    I tried brew install --with-clang --with-lld --with-python --HEAD llvm as suggested in the other answer, but it gave me an error:

    Error: invalid option: --with-clang
    

    brew options llvm also showed nothing.

    Then I found another page that suggests the simple

    brew install llvm
    

    This worked for me. It is with homebrew 2.4.0, on MacOS Mojave.

    If you need to have llvm first in your PATH run (replace with your username):

    echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> /Users//.bash_profile
    

    For compilers to find llvm you may need to set:

    export LDFLAGS="-L/usr/local/opt/llvm/lib"
    export CPPFLAGS="-I/usr/local/opt/llvm/include"
    

提交回复
热议问题