Computer Laboratory

SOAAP

Building SOAAP and related tools

We are pleased to announce that an early prototype version of the Clang/LLVM- based SOAAP toolchain is now available to try out. Please send any queries to Khilan Gudka and Robert Watson.

Some preliminary notes:

  • Currently SOAAP is built, run and tested on FreeBSD 10.0.
  • Create a directory in which all soaap-related files will reside. In these instructions, we will assume the directory '/home/me/workspace' is used for this purpose.
  • CMake >= 2.8.9 and Ninja 1.0.0 are required to build Clang/LLVM and the Soaap LLVM pass.
  • SOAAP requires libc++ r194154 or newer. If you cannot build SOAAP, it might be because your libc++ isn't new enough. A more recent version can be installed from ports. The -DCMAKE_PREFIX_PATH=/usr/local below takes care of finding a ports installation of libc++.

LLVM/Clang

[me@mymachine ~/workspace]$ git clone https://github.com/CTSRD-SOAAP/llvm.git
[me@mymachine ~/workspace]$ cd llvm
[me@mymachine ~/workspace/llvm]$ git checkout working
[me@mymachine ~/workspace/llvm]$ cd tools
[me@mymachine ~/workspace/llvm/tools]$ git clone https://github.com/CTSRD-SOAAP/clang.git
[me@mymachine ~/workspace/llvm/tools]$ cd clang
[me@mymachine ~/workspace/llvm/tools/clang]$ git checkout working
[me@mymachine ~/workspace/llvm/tools/clang]$ cd ../..
[me@mymachine ~/workspace/llvm]$ mkdir Build
[me@mymachine ~/workspace/llvm]$ cd Build
[me@mymachine ~/workspace/llvm/Build]$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DCMAKE_CXX_FLAGS="-I/usr/local/include/c++/v1 -O1 -idirafter /usr/local/include" -DCMAKE_C_COMPILER="/usr/bin/clang" -DCMAKE_C_FLAGS="-idirafter /usr/local/include" ..
[me@mymachine ~/workspace/llvm/Build]$ ninja (note: you can customise the number of threads used by ninja using the -j flag)

SOAAP tool

[me@mymachine ~/workspace/llvm/Build]$ cd ../..
[me@mymachine ~/workspace]$ git clone https://github.com/CTSRD-SOAAP/soaap.git
[me@mymachine ~/workspace]$ cd soaap
[me@mymachine ~/workspace/soaap]$ mkdir Build
[me@mymachine ~/workspace/soaap]$ cd Build
[me@mymachine ~/workspace/soaap/Build]$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLLVM_DIR=`pwd`/../../llvm/Build/share/llvm/cmake -DCMAKE_C_COMPILER=`pwd`/../../llvm/Build/bin/clang -DCMAKE_CXX_COMPILER=`pwd`/../../llvm/Build/bin/clang++ -DCMAKE_PREFIX_PATH=/usr/local ..
[me@mymachine ~/workspace/soaap/Build]$ ninja

Everything is built and ready to use!