使用LLVM编译代码时出错

时间:2014-10-25 22:23:45

标签: haskell compilation llvm

我正在尝试使用网页末尾显示的make编译here中显示的代码,但是我收到以下错误:

[1 of 1] Compiling Main             ( mandelbrot.hs, mandelbrot.o )

<no location info>:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM

我检查了ghc的设置文件,发现它是这样的:

 ("LLVM llc command", ""),
 ("LLVM opt command", "")

所以我改为映射命令如下:

 ("LLVM llc command", "llc"),
 ("LLVM opt command", "opt")

但现在我的错误略有不同:

[1 of 1] Compiling Main             ( mandelbrot.hs, mandelbrot.o )

<no location info>:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM

在网上搜索可能的原因,但结果指向旧错误报告,其中说明此问题已修复。

我对LLVM没有任何经验,也不知道如何处理。

我使用Windows 7 64位与Glorious Glasgow Haskell编译系统,版本7.8.3。

1 个答案:

答案 0 :(得分:-1)

没有真正回答你的问题,但我在Mac上使用LLVM 3.4.2进行构建(LLVM 3.5无效)。似乎LLVM对此有一些实质性的好处。

使用LLVM

$ time ./Mandlebrot +RTS -N4 -RTS 16000 > /dev/null

real    0m10.635s
user    0m36.169s
sys 0m0.167s

没有LLVM

$ time ./Mandlebrot-nollvm +RTS -N4 -RTS 16000 > /dev/null

real    0m16.044s
user    1m0.704s
sys 0m0.165s

很抱歉,它对Windows没有帮助。在Windows上安装开发工具很困难。这是我不使用Windows的主要原因。

相关问题