安装LLVM时出现错误,望达人帮忙解决

编译打包和其他
回复
kano8453
帖子: 1
注册时间: 2012-02-24 22:22

安装LLVM时出现错误,望达人帮忙解决

#1

帖子 kano8453 » 2012-02-24 22:31

1.Download the LLVM source and unpack it:

wget http://llvm.org/releases/2.7/llvm-2.7.tgz
tar xzf llvm-2.7.tgz
mv llvm-2.7 llvm
or check out the latest version from subversion:

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
2.Download the llvm-gcc-4.2 source and unpack it:

wget http://llvm.org/releases/2.7/llvm-gcc-4 ... source.tgz
tar xzf llvm-gcc-4.2-2.7.source.tgz
mv llvm-gcc-4.2-2.7.source llvm-gcc-4.2
or check out the latest version from subversion:

svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk llvm-gcc-4.2
3.Make a build directory llvm-objects for llvm and make it the current directory:

mkdir llvm-objects
cd llvm-objects
4.Configure LLVM (here it is configured to install into /usr/local):

../llvm/configure --prefix=/usr/local --enable-optimized --enable-assertions
If you have a multi-compiler setup and the C++ compiler is not the default, then you can configure like this:

CXX=PATH_TO_C++_COMPILER ../llvm/configure --prefix=/usr/local --enable-optimized --enable-assertions
To compile without checking (not recommended), replace --enable-assertions with --disable-assertions.

5.Build LLVM:

make
6.Install LLVM (optional):

make install
7.Make a build directory llvm-gcc-4.2-objects for llvm-gcc and make it the current directory:

cd ..
mkdir llvm-gcc-4.2-objects
cd llvm-gcc-4.2-objects
8. Configure llvm-gcc (here it is configured to install into /usr/local). The --enable-checking flag turns on sanity checks inside the compiler. To turn off these checks (not recommended), replace --enable-checking with --disable-checking. Additional languages can be appended to the --enable-languages switch, for example --enable-languages=ada,c,c++.

../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c \
--enable-checking --enable-llvm=$PWD/../llvm-objects \
--disable-bootstrap --disable-multilib
If you have a multi-compiler setup, then you can configure like this:

export CC=PATH_TO_C_AND_ADA_COMPILER
export CXX=PATH_TO_C++_COMPILER
../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c \
--enable-checking --enable-llvm=$PWD/../llvm-objects \
--disable-bootstrap --disable-multilib
Build and install the compiler:

9.make
make install
当运行到最后一部时出现以下错误

gcc: error: gengtype-lex.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
make[3]: *** [build/gengtype-lex.o] Error 4
make[3]: Leaving directory `/home/kano/llvm-gcc-4.2-objects/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/kano/llvm-gcc-4.2-objects'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/kano/llvm-gcc-4.2-objects'
make: *** [all] Error 2
望达人帮忙
头像
cuihao
帖子: 4793
注册时间: 2008-07-24 11:33
来自: 郑州
联系:

Re: 安装LLVM时出现错误,望达人帮忙解决

#2

帖子 cuihao » 2012-02-24 23:42

就不能用源里面的么?(还是源里没有?)
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 绿
Site: CUIHAO.TK    Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
回复