llvm - 如何为Mac安装LLVM?

标签 llvm macos-sierra

如何在macOS Sierra上安装LLVM?我已经尝试过brew install llvm,但是当尝试使用像lli这样的llvm命令时,出现命令未找到错误。

最佳答案

homebrew不会将llvm链接到/usr/local/bin,因为它可能与系统之一冲突,从而导致各种讨厌的错误。相反,您应该使用完整路径来调用它们,例如/usr/local/opt/llvm/bin/lli

实际上,现在列出了一个警告,说明了这一点...

==> Caveats
==> llvm

To use the bundled libc++ please add the following LDFLAGS:
LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH run:
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.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"

关于llvm - 如何为Mac安装LLVM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42730345/

相关文章:

macos - .bash_profile 语法错误 : unexpected end of file

command-line - 如何确定LLVM版本?

g++ - 如何从 shell 编译 macOS Sierra 上使用 dylib 路径的源代码

mysql - 传递版本属性时mysql版本的差异

在 macOS Sierra 上使用 OpenSSL 的 python 请求

ruby - 从 Docker 容器登录到 macOS 中的系统日志/控制台?

visual-c++ - Windows上的__block以便编译libdispatch

xcode - 在每个功能/每个代码块的基础上启用 SSE4 的正确方法?

python - 为什么LLVM在创建数组时会抛出 "arguments of incompatible type"错误?

linux - 从源代码安装后如何卸载 libc++?