安装KLEE-LLVM2.9

安装klee 系统ubuntu14.04 64位 llvm2.9

1.安装依赖

 sudo apt-get install g++ python curl cmake git bison flex bc libcap-dev 
sudo apt-get install minisat
$ export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu  
$ export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
2.安装llvm2.9

cd ~

mkdir work

cd work

下载 llvm-gcc4.2-2.9-x86_64-linux.tar

解压生成 llvm-gcc4.2-2.9-x86_64-linux

 

echo "export PATH=\$PATH:~/work/llvm-gcc4.2-2.9-x86_64-linux/bin" >> ~/.bashrc

source ~/.bashrc

 

下载llvm-2.9

 

$ tar zxvf llvm-2.9.tgz  

$ cd llvm-2.9  

$ ./configure --enable-optimized --enable-assertions  

$ make

出现错误

Intercept.cpp:69:67:error'lseek64' was not declaredin this scope

/bin/rm:cannot remove '/llvm-2.9/ExecutionEngine/JIT/Releasr+Asserts/Intercept.d.tmp': no such file or directory

解决方法:在llvm-2.9/lib/ExecutionEngine/JIT/Intercept.cpp中加入#include<unistd.h>

在#include<sys/stat.h>和#endif之间

重新$ ./configure --enable-optimized --enable-assertions  ,make编译通过

3.安装STP

$ git clone https://github.com/stp/minisat.git
$ cd minisat
$ mkdir build
$ cd build
$ cmake ../
$ make
$ sudo make install
$ git clone https://github.com/stp/stp.git
tar xzfv 2.1.0.tar.gz  
$ cd stp-2.1.0
$ mkdir build
$ cd build
$ cmake ..  
$ make
$ sudo make install
$ ulimit -s unlimited
4.可选 uclibc and the POSIX environment model

$ git clone https://github.com/klee/klee-uclibc.git
$ cd klee-uclibc
$ ./configure --make-llvm-lib
$ make -j2
$ cd ..
5.安装klee

$ git clone https://github.com/klee/klee.git
./configure --with-llvm=full-path-to-llvm --with-stp=full-path-to-stp/build --with-uclibc=full-path-to-klee-uclibc --enable-posix-runtime
注意,安装路径为自己的路径

$ make ENABLE_OPTIMIZED=1
6.检测安装

$ make check  
$ make unittests  
测试时,运行命令
klee get_sign.o

时出现错误

stp: error while loading shared libraries: libstp.so.2.1: cannot open shared object file: No such file or directory

解决方法,重新安装stp,cmake时增加以下参数
cmake -DENABLE_PYTHON_INTERFACE:BOOL=OFF  -DBUILD_SHARED_LIBS:BOOL=OFF ..
在klee的Makefile.common中做以下修改
- LD.Flags += -L $(STP_ROOT) /lib
+LD.Flags += -L$(STP_ROOT)/lib -Wl,-rpath,$(STP_ROOT)/lib
然后重新安装。


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值