系统: macOS mojave 10.14.6
当我使用brew install llvm
时,会出现此错误:
Error: cmake: undefined method `on_linux' for #<Class:0x00007f7f744bf6b8>
我碰巧有一台莫哈韦机器,并自己重新进行了安装过程,它工作正常。
这是我所做的:
brew install llvm
(我实际上使用了brew reinstall llvm
,因为它对我来说reinstall
(echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
,酿造版本将在您的PATH
source ~/.bash_profile
,应用PATH
更改
完整的安装日志:
$ 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
测试日志(更改PATH
后(:
$ clang --version
clang version 10.0.0
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin