Cannot build LLVM and Clang

10,931

Solution 1

The instruction given on this site work!

Solution 2

I had the same problem. As Eli suggested, I got the 3.0 release. It doesn't come with a 'getting started' but you can follow the INSTALL file from clang's root top.

You should be able to copy/paste the following (as root of course for the /usr/local/ part)

export NUMCPU=4 # or however many cores you want to paralell build with
export ORIGDIR=$PWD
wget http://llvm.org/releases/3.0/llvm-3.0.tar.gz
tar -zxf llvm-3.0.tar.gz
cd llvm-3.0.src/tools
wget http://llvm.org/releases/3.0/clang-3.0.tar.gz
tar -zxf clang-3.0.tar.gz
mv clang-3.0.src clang
cd $ORIGDIR
mkdir build
cd build
../llvm-3.0.src/configure --prefix=/usr/local
make -j$NUMCPU
cd tools/clang
make install

--

update, I should also note that following the 'getting started guide' with latest subversion (2012 09 10) actually does work , and i copy/pasted the lines exactly from the 'getting started' page http://clang.llvm.org/get_started.html (including 'optional' stuff) on a Fedora machine on ppc64.

Share:
10,931
MetallicPriest
Author by

MetallicPriest

Updated on June 25, 2022

Comments

  • MetallicPriest
    MetallicPriest almost 2 years

    I have tried to compile clang and llvm using the clang getting started manual. However, at step 5, when I do make, I get the following error. Any idea what is going on here, and how to fix it? Note that I am using Ubuntu 10.04 on a 64 bit x86 system.

    cp: cannot stat `/home/MetallicPriest/Desktop/build/tools/clang/runtime/compiler-rt/clang_linux/full-x86_64/libcompiler_rt.a': No such file or directory
    make[4]: *** [/home/MetallicPriest/Desktop/build/Debug+Asserts/lib/clang/3.1/lib/linux/libclang_rt.full-x86_64.a] Error 1
    rm /home/MetallicPriest/Desktop/build/Debug+Asserts/lib/clang/3.1/lib/linux/.dir
    make[4]: Leaving directory `/home/MetallicPriest/Desktop/build/tools/clang/runtime/compiler-rt'
    make[3]: *** [compiler-rt/.makeall] Error 2
    make[3]: Leaving directory `/home/MetallicPriest/Desktop/build/tools/clang/runtime'
    make[2]: *** [all] Error 1
    make[2]: Leaving directory `/home/MetallicPriest/Desktop/build/tools/clang'
    make[1]: *** [clang/.makeall] Error 2
    make[1]: Leaving directory `/home/MetallicPriest/Desktop/build/tools'
    make: *** [all] Error 1
    ## Heading ##
    
  • Eli Bendersky
    Eli Bendersky about 12 years
    The "clang getting started" instructions worked fine for me, multiple times on multiple machines and Ubuntu versions, without ever building libc++. So I wonder what's different in your case