Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't compile Rust

Tags:

rust

llvm

I'm on Debian and following the compile instructions from the Rust wiki: https://github.com/mozilla/rust/wiki/Doc-getting-started

I tried a couple of times but it always ends up with the following error:

llvm[3]: Compiling opt.cpp for Release+Asserts build
make[3]: *** No rule to make target `/home/user/rust/llvm/x86_64-unknown-linux-
gnu/tools/lib/libLLVMipo.a', needed by `/home/user/rust/llvm/x86_64-unknown-
linux-gnu/Release+Asserts/bin/opt'.  Stop.
make[3]: Leaving directory `/home/user/rust/llvm/x86_64-unknown-linux-gnu/
tools/opt'
make[2]: *** [opt/.makeall] Error 2
make[2]: Leaving directory `/home/user/rust/llvm/x86_64-unknown-linux-gnu/tools'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/user/rust/llvm/x86_64-unknown-linux-gnu'
make: *** [/home/user/rust/llvm/x86_64-unknown-linux-gnu/Release+Asserts/
bin/llvm-config]  Error 2

Edit:

The problem only occurs whithin a debootstrap/chroot environment, not within a full Debian Installation.

like image 787
sofarsogood Avatar asked Feb 15 '12 17:02

sofarsogood


People also ask

Why Rust needs C++ build tools?

Why do I need Microsoft C++ build tools in order to install the Rust Compiler? Because you need a linker. (Edit: import libraries and other tools like rc , too.)

How long does it take to compile the Rust compiler?

The tests of my Rust range-v3 like library compile in ~12 seconds. The tests of C++'s range-v3 take ~320 seconds to compile. The incremental compile of the same library takes in Rust ~1 second.


2 Answers

If you're referring to these instructions:

git clone git://github.com/mozilla/rust.git
cd rust
mkdir build
cd build
../configure
make check

...I can see at least one thing wrong with them. Try this instead:

git clone git://github.com/mozilla/rust.git
cd rust
git submodule update --init
./configure
make
sudo make install

The git submodule update --init is necessary to initialize Rust's submodules, which include LLVM and libuv.

like image 165
B. Striegel Avatar answered Oct 03 '22 01:10

B. Striegel


git submodule update shouldn't be needed, as Rust's configure script tries to handle that itself, but if you run git submodule status and see lines about changes to src/libuv or src/llvm then it could be a problem.

I haven't seen that error before and can't tell what's wrong from that snippet. Possibly run make clean-all then gist the full output of ./configure && make, as well as the contents of config.mk. Also, you will probably get more attention with this question on the rust bug tracker: http://github.com/mozilla/rust/issues

like image 41
brson Avatar answered Oct 03 '22 01:10

brson