Monday, September 23, 2013

LLVM

LLVM (Low Level Virtual Machine)

Compiler Technology Components
ClooG:
CLooG is a free software and library to generate code for scanning Z-polyhedra. Install CLoog for Polly.

Polly:
Polly is a polyhedral optimizer for LLVM.

Clang:
Clang is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM compiler.

lld:
The LLVM Linker.

LLDB:
LLDB is a high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler.

libcxx:
libc++ is a new implementation of the C++ standard library, targeting C++11.

How to build LLVM on MacBook Air

$ mkdir LLVM
$ cd LLVM
$ wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz
$ wget http://llvm.org/releases/3.4/clang-3.4.src.tar.gz
$ wget http://llvm.org/releases/3.4/compiler-rt-3.4.src.tar.gz
$ tar zxf llvm-3.4.src.tar.gz
$ tar zxf clang-3.4.src.tar.gz
$ tar zxf compiler-rt-3.4.src.tar.gz
$ mv clang-3.4/ llvm-3.4/tools/clang/
$ mv compiler-rt-3.4/ llvm-3.4/projects/compiler-rt/

$ mkdir llvm-3.4.build
$ cd llvm-3.4.build
$ ../llvm-3.4/configure --enable-shared
$ time make
 . . . . . . wait . . . . . .

real   88m6.255s
user  82m21.556s
sys   4m25.115s

$ make check-all

Before starting to use LLVM, please remember to include the LLVM binaries in our path.

#(?) Now, you can compile C code by using the clang -- the C front-end for the LLVM compiler.

No comments: