trying to compile llvm+clang on CentOS 5

I am trying to have llvm and clang on a centOS 5 without root permissions. I tried to do it downloading llvm and clang src packages and trying the ususal configure, make and make install steps as such:

wget [http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz](http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz)
wget [http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz](http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz)
tar xzf llvm-3.3.src.tar.gz && cd llvm-3.3.src/tools/ && tar xzf ../../cfe-3.3.src.tar.gz

I tried with a newer version of gcc compiled for this 64bit CentOS system, because the older version wouldn’t work (see below). When I try it with the newer version, I get this:

export LD_LIBRARY_PATH=/home/avilella/src/gcc/gcc-4.7.2/lib64:/home/avilella/src/gcc/gcc-4.7.2/lib
export CC=/home/avilella/src/gcc/gcc-4.7.2/bin/gcc
export CXX=/home/avilella/src/gcc/gcc-4.7.2/bin/g++  
export PATH=/home/avilella/src/python/python-2.7.3/bin:$PATH
cd ~/src/llvm/latest/llvm-3.3.src
./configure --prefix=/home/avilella/src/llvm/latest/llvm && make clean && make -j8 && make install

After these steps, I don’t see clang in the bin directory:

/home/avilella/src/llvm/latest/llvm/bin    

So I followed the instructions in the clang directory, and ran make -j8 on it:

cd ~/src/llvm/latest/llvm-3.3.src/tools/cfe-3.3.src
make -j8

Doing so, I get this clange/Config/config.h error:

[...]
InitHeaderSearch.cpp:17:51: fatal error: clang/Config/config.h: No such file or directory
[...]

This is mentioned in a bug report from 2011, which I would be solved by now:

http://llvm.org/bugs/show_bug.cgi?id=11903

Albert Vilella <avilella@gmail.com> writes:

I am trying to have llvm and clang on a centOS 5 without root permissions.
I tried to do it downloading llvm and clang src packages and trying the
ususal configure, make and make install steps as such:

wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz
wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz
tar xzf llvm-3.3.src.tar.gz && cd llvm-3.3.src/tools/ && tar xzf
../../cfe-3.3.src.tar.gz

This is wrong, because it doesn't create a directory named `clang' under
$LLVM_SRC_ROOT/tools. Rename the directory created by the last tar
command (`cfe-3.3.src') to `clang' and reconfigure.

P.S.: it is recommended to use a separate build directory instead of
building on the directory where the source code is.