The solution is simple. I’m going to write (in summary form) the docs that the
LLVM and Clang projects should have written in the first place.
-
Go to llvm.org/releases/download.html and download all the sources except the
LLVM test suite. (You can download it if you like, actually, but if you do
you’ll have to figure out where to place it on your own. Probably in the
projects
directory.)
-
Untar the tarballs. Make a note of where the llvm tarball expands to. That
directory will be referred to as llvm
in the instructions below. Also the
version you downloaded will be referred to as version
.
-
Move the cfe-version
.src directory to llvm
/tools/clang
-
Move the lld-version
.src directory to llvm
/tools/lld
-
Move the lldb-version
.src directory to llvm
/tools/lldb
-
Move the polly-version
.src directory to llvm
/tools/polly
-
Move the clang-tools-extra-version
.src directory to
llvm
/tools/clang/tools/extra
-
Move the compiler-rt-version
.src llvm_root
/projects/compiler-rt
-
Move the libcxx-version
.src llvm_root
/projects/libcxx
-
Move the libcxxabi-version
.src llvm_root
/projects/libcxxabi
-
Move the libunwind-version
.src llvm_root
/projects/libunwind
-
Move the openmp-version
.src llvm_root
/projects/openmp
Now change your working directory to llvm
and issue:
Now here you have to decide if you want to make a debug build or a release
build. For a debug build:
|
I personally want a release build and I want to install to /usr/local. I thus
use:
You’ll have to read the detailed docs if you want to do anything
even more customized.
|
Now you just use normal make
and make install
commands.
|
I think I just spent more time documenting the process for the first-time user
than the project maintainers did!
|
It gets easier, of course. You could have this in a script. Indeed the LLVM
and Clang projects could even supply you with one. If they did it might look
something like…