Skip to content
Jonathan Anderson edited this page Mar 28, 2016 · 3 revisions

The original TESLA prototype was built on Clang/LLVM 3.3, so some special effort is required when building it.

Get Clang/LLVM 3.3

It is important to build Clang/LLVM from our tesla-maintenance branches, which incorporate backported bug fixes.

Check out LLVM and Clang:

$ git clone https://github.com/cadets/llvm -b tesla-maintenance llvm
Cloning into 'llvm'...
[...]
$ git clone https://github.com/cadets/clang -b tesla-maintenance llvm/tools/clang
Cloning into 'llvm/tools/clang'...
[...]

Build LLVM in Release mode (or substitute Debug for Release below to get a very slow but thoroughly introspective version of Clang/LLVM):

$ mkdir Release
$ cd Release
Release$ cmake -G Ninja -D CMAKE_BUILD_TYPE=Release ../llvm
Release$ ninja

CCache users:

You can enable CCache by passing -D CMAKE_C_COMPILER=/usr/local/libexec/ccache/cc, -D CMAKE_CXX_COMPILER=/usr/local/libexec/ccache/c++, etc., to CMake.

Build TESLA

Now, check out TESLA:

$ git clone https://github.com/cadets/tesla

Then, set your PATH to prefer your just-built Clang/LLVM instance:

export LLVM_BUILD_DIR=/path/to/LLVM/Release
export PATH=${LLVM_BUILD_DIR}/bin:$PATH

Finally, build TESLA itself:

$ mkdir -p Release     # or Debug!
$ cd Release
Release$ cmake -G Ninja \
  -D CMAKE_BUILD_TYPE=${BUILD_TYPE} \
  -D CMAKE_C_COMPILER=clang \
  -D CMAKE_CXX_COMPILER=clang++ \
  -D CMAKE_CXX_FLAGS="-stdlib=libc++" \
  ..
Release$ ninja

(or use -D CMAKE_C_COMPILER=/usr/local/libexec/ccache/cc and -D CMAKE_CXX_COMPILER=/usr/local/libexec/ccache/c++ as above)

Clone this wiki locally