So I'm trying to install Halide on my Ubuntu 12.04 (64bit). I need llvm-3.2 and clang to be installed.
Running sudo apt-get install llvm-3.2
ends up with 'package not found'.
Trying sudo apt-get install llvm
or sudo apt-get install clang
installs 2.9 versions. Google helped me with this
sudo add-apt-repository ppa:kxstudio-team/builds
sudo apt-get update
Now, sudo apt-get install llvm-3.2 clang-3.2
works. But when I run make in Halide folder I still get clang:Command not found.
Ok, so I successfully compiled Halide on Ubuntu 13.04 by installing
llvm
,clang
, andbuild-essential
. My only guess as to your issue is that the LLVM or clang from the PPA you installed might not have worked quite right. It seems it's actually possible to get LLVM 3.2 from Ubuntu for 12.04, via what is known as the "proposed" archive. You might try purging the LLVM you have and installing it from "proposed". I'll explain how to do that below. Since you mentioned you're new to Ubuntu (in the original question version), I'll first explain what each command you've already used does, as best I can.So,
sudo apt-get install llvm-3.2
attempts to install the package namedllvm-3.2
from the current repositories enabled on your system. In your case, it couldn't be found, so the command failed.sudo apt-get install llvm
installed thellvm
package, which is probably a special package that just uses the most up-to-date LLVM available in your standard repositories. In your case, that was 2.9. Same idea applies tosudo apt-get install clang
.sudo add-apt-repository ppa:kxstudio-team/builds
adds what's called a personal package archive or PPA to your system. This lets you get more software from another repository, or software source. See https://help.launchpad.net/Packaging/PPA for more info. Finally,sudo apt-get update
tells Ubuntu to get information on what packages are available from the currently available repositories. You might take a look at http://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html for more info on package management in Debian (most of which should apply to Ubuntu as well, since Ubuntu is based on Debian).So, the steps to remove the packages you've got and install the versions available from precise-proposed:
sudo apt-get purge llvm-3.2 clang-3.2
to completely remove LLVM and clang from your system.sudo add-apt-repository --remove ppa:kxstudio-team/builds
to remove the PPA from your system.llvm-3.2
package, and the second will keep the system from trying to upgrade everything to the Proposed versions.sudo apt-get update
to pull in the information on what packages and versions are now available.sudo apt-get install llvm-3.2/precise-proposed
to install LLVM 3.2, and usesudo apt-get install clang/precise-proposed
to install Clang 3.0 (I think that's the version you should get).sudo ln -s /usr/bin/llvm-config-3.2 /usr/local/bin/llvm-config
to make the system treatllvm-config-3.2
(which is thellvm-config
that came withllvm-3.2
) asllvm-config
. More completely, this creates a symbolic link (or symlink) to llvm-config-3.2 in another place where Ubuntu will look for programs (more info: ln, FHS, PATH). Thus, when you run "llvm-config", Ubuntu will find the symlink and run the program it points to (llvm-config-3.2
).Hopefully that works. I've not tested any of this, so use at your own risk, etc. I'm pretty sure, however, that it shouldn't do anything terrible.
EDIT: Note that
llvm
andllvm-3.2
are independent.llvm
depends onllvm-2.9
(see here), whilellvm-3.2
is separate (see dependencies here)Also, I'm not sure if you know about tab completion; it can be helpful if you're looking for a command but don't quite know the name (for example, in this case, it would probably have shown that
llvm-config
was calledllvm-config-3.2
).