2011-12-07 46 views
0

我试图在我的机器上获得llvm 3.0,但是当我给make -k时,出现以下错误。错误构建llvm 3.0

[email protected]:~/llvm-3.0$ make 
make[1]: Entering directory `/home/chethan/llvm-3.0/lib/Support' 
llvm[1]: Compiling APFloat.cpp for Release build 
In file included from APFloat.cpp:15: 
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/APFloat.h:104: 
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/APInt.h:18: 
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/ArrayRef.h:13: 
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/SmallVector.h:17: 
/home/chethan/llvm-3.0/include/llvm/Support/type_traits.h:20:10: fatal error: 'utility' file not found 
#include <utility> 
    ^
1 error generated. 
make[1]: *** [/home/chethan/llvm-3.0/lib/Support/Release/APFloat.o] Error 1 
make[1]: Leaving directory `/home/chethan/llvm-3.0/lib/Support' 
make: *** [all] Error 1 

我按照这些步骤在我的机器上构建llvm。

  1. 获得从LLVM下载页面LLVM的源zip文件并解压到文件夹LLVM-3.0
  2. CD /home/chethan/llvm-3.0
  3. 的./configure
  4. 使-k

虽然在这种情况下,我只是给了'make',以便它在第一个错误时停止。我的机器上安装了llvm-gcc 4.2。

我今天早上在我的家用机器上遵循了相同的步骤,并成功构建了llvm-3.0!任何想法可能在这里失踪?

+0

我会在LLVM邮件列表,IRC或论坛上提问。 –

回答

7

配置为CC=gcc CXX=g++。它看起来像配置脚本找到一个实际上没有正确设置编译C++代码的clang版本。

+0

谢谢@servn,解决了问题! –

+0

如果可能的话从PATH变量中删除(如果有)clang,clang ++,那么它应该自动选择gcc/g ++ – sdkie