Building from sources

In the absence of prebuilt binaries, LLVM and Clang can be built from scratch by obtaining the source code first. Building the project from the source is a good way to start understanding more about the LLVM structure. Additionally, you will be able to fine-tune the configuration parameters to obtain a customized compiler.

System requirements

An updated list of the LLVM-supported platforms can be found at http://llvm.org/docs/GettingStarted.html#hardware. Also, a comprehensive and updated set of software prerequisites to compile LLVM is described at http://llvm.org/docs/GettingStarted.html#software. In Ubuntu systems, for example, the software dependencies can be resolved with the following command:

$ sudo apt-get install build-essential ...

Get Getting Started with LLVM Core Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.