1. Install dependencies
$ sudo apt-get install build-essential curl libcap-dev git cmake libncurses5-dev python-minimal python-pip unzip
2. Install LLVM 3.4
Please refer to this cite.
Note:
- KLEE is currently tested on Linux x86-64, and might break on x86-32.
- If you build LLVM and Clang 3.4 from source DO NOT USE CMAKE TO BUILD IT. Use LLVM’s Autoconf/Makefile build system. Although KLEE’s CMake build system is independent of the build system used to build LLVM and Clang a bug in LLVM 3.4 means that if CMake is used to build LLVM then it will likely lead to RTTI related linking errors.
3. Install constraint solver(s)
Here we install STP as the constraint solver.
STP has a few external dependencies they are listed below as an install command for Ubuntu 14.04LTS.
$ sudo apt-get install cmake bison flex libboost-all-dev python perl zlib1g-dev
$ git clone https://github.com/stp/minisat.git
$ cd minisat
$ mkdir build
$ cd build
//$ cmake -DSTATIC_BINARIES=ON -DCMAKE_INSTALL_PREFIX=/usr/ ../
$ cmake ../
$ make
$ sudo make install
$ cd ../../
$ git clone https://github.com/stp/stp.git
$ cd stp
$ git checkout tags/2.1.2
$ mkdir build
$ cd build
Then,
Shared STP libraries cause problems for KLEE, so we have to disable them (see this mailing list thread). The python interface requires shared libraries, so we have to disable that, too.
$ cmake -DBUILD_SHARED_LIBS