Installation instructions

In order to understand the guts of KleeNet, we strongly advice to first read the documentation (incl. tutorials) of KLEE and the OSDI'08, IPSN'10 papers. KleeNet runs on Linux (x86, x86_64), Mac OS X (Darwin 10.6.0), and is compatible with KLEE. For a 64 bit Mac (Darwin 10.6.0), use the Apple shipped llvm-gcc. Here, we assume the LLVM 2.9 version (KleeNet runs with 2.7 and 2.8 as well). Due to KLEE's limitation, KleeNet will not compile with newer llvm versions!

Before beginning the installation, setup the following environment variables. You may want to put them in your ~/.bashrc.

# Assuming you wish to install kleenet in ~/code/. Of course you can change that to any directory you like.
export WORK="$HOME/code" 
export KLEENET="$WORK/kleenet-public" 
export LLVM_VERSION="2.9" 
export LLVM_ARCH="x86_64-linux" 
# get the OS binaries found at for your llvm version, e.g.:
export LLVM_GCC_BIN_DIR="$WORK/llvm-gcc-4.2-${LLVM_VERSION}-${LLVM_ARCH}/bin" 

# You may bild Debug+Asserts or Release+Asserts. For most users Release+Asserts will be better.
export PATH="$LLVM_GCC_BIN_DIR:$KLEENET/Release+Asserts/bin:$KLEENET/scripts:$KLEENET/utils/hacks/TreeGraphs/:$LLVM_HOME/Release/bin:$PATH" 

Make sure you have the following tools installed: g++ git dejagnu bison flex make

1. Install llvm-gcc.

cd "$WORK" 
# Unfortunately the links to llvm-gcc vary for each llvm-version and architecture, so, you have to figure that out yourself from
wget$LLVM_VERSION/llvm-gcc-4.2-2.9-x86_64-linux.tar.bz2 -O - | tar -xj
# verify with
$ which llvm-gcc

2. Then, download and build LLVM 2.9.

cd "$WORK" 
wget "${LLVM_VERSION}/llvm-${LLVM_VERSION}.tgz" -O - | tar -xz
cd "$LLVM_HOME" 
# For building Release:
./configure --enable-optimized
# For building Debug+Asserts say instead:
# ./configure --disable-optimized --enable-assertions
# You may want to use fewer/more jobs (depending of the number of processors you have).
# Building LLVM takes a bit.
make -j4

3. Clone, KleeNet from our git repository and build it.

cd "$WORK" 
git clone "" 

cd "$KLEENET" 
# see for specific configuration options if necessary. The configuration options for KleeNet are identical to those of KLEE.
# You might want uclibc.
./configure --with-llvm="$LLVM_HOME" 
# For Debug+Asserts mode, also add the configure flags:
#  --with-llvm-build-mode=Debug+Asserts --with-runtime=Debug+Asserts --disable-optimized
# For stp:
#  --with-stp="$STP_HOME" 
# For uclibc:
#  --with-uclibc="$KLEE_UCLIBC_HOME" --enable-posix-runtime
$ make

4. Run the regression suite to verify your build:

make check
make unittests

If you have any compilations problems/segfaults, simply mail us.