OS X 10.9.2中缺少LLVM选项

时间:2014-04-21 13:54:13

标签: macos llvm homebrew ghc

我正在使用Haskell的GHC来创建LLVM代码,但它无法从LLVM中找到opt。我搜索了问题,建议从自制程序安装LLVM,我做了,但我的路径上没有opt二进制文件。我想知道从哪里可以得到它所以我从GHC编译LLVM代码?

2 个答案:

答案 0 :(得分:0)

我找到的唯一解决方案是从LLVM网站下载预构建的二进制文件:http://llvm.org/releases/download.html

答案 1 :(得分:0)

Homebrew非常清楚它如何安装LLVM:

~$ brew install llvm
==> Downloading https://homebrew.bintray.com/bottles/llvm-3.6.2.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/llvm-3.6.2.mavericks.bottle.tar.gz
==> Pouring llvm-3.6.2.mavericks.bottle.tar.gz
==> Caveats
LLVM executables are installed in /usr/local/opt/llvm/bin.
Extra tools are installed in /usr/local/opt/llvm/share/llvm.

This formula is keg-only, which means it was not symlinked into /usr/local.

OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/llvm/lib
    CPPFLAGS: -I/usr/local/opt/llvm/include

==> Summary
  /usr/local/Cellar/llvm/3.6.2: 811 files, 291M

所以在执行任何需要LLVM的GHC命令之前,我所做的只是export PATH=/usr/local/opt/llvm:$PATH