简体   繁体   English

无法在 macOS mojave 上使用自制软件安装 llvm

[英]cannot install llvm using homebrew on macOS mojave

System: macOS mojave 10.14.6系统:macOS mojave 10.14.6

when I use brew install llvm , this error appears:当我使用brew install llvm时,出现此错误:

Error: cmake: undefined method `on_linux' for #<Class:0x00007f7f744bf6b8>

I happened to have a Mojave machine and re-did the installation process myself, and it works fine.我碰巧有一台 Mojave 机器,我自己重新做了安装过程,它工作正常。

Here is what I did:这是我所做的:

  • brew install llvm (I actually used brew reinstall llvm , since it is reinstall for me) brew install llvm (我实际上使用了brew reinstall llvm ,因为它是为我reinstall的)
  • echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile , brew version would be on your PATH echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile ,brew 版本将在您的PATH
  • source ~/.bash_profile , apply the PATH change source ~/.bash_profile ,应用PATH更改

The full installation log:完整的安装日志:

$ brew reinstall llvm
==> Downloading https://homebrew.bintray.com/bottles/llvm-10.0.0_3.moj
Already downloaded: /Users/rchen/Library/Caches/Homebrew/downloads/6d4c3816f98949b64550d4a36656b2661f8e5aeea36a90abbdbea68c8215b9a2--llvm-10.0.0_3.mojave.bottle.tar.gz
==> Reinstalling llvm
==> Pouring llvm-10.0.0_3.mojave.bottle.tar.gz
==> Caveats
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"' >> /Users/rchen/.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"

==> Summary
🍺  /usr/local/Cellar/llvm/10.0.0_3: 7,055 files, 1GB

test log (after PATH change):测试日志( PATH更改后):

$ clang --version
clang version 10.0.0
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM