安装KLEE-LLVM2.9
2015-11-13 15:33
603 查看
安装klee 系统ubuntu14.04 64位 llvm2.9
1.安装依赖
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
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[/code]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[/code]./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,cmake时增加以下参数
stp: error while loading shared libraries: libstp.so.2.1: cannot open shared object file: No such file or directorycmake -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
然后重新安装。
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- ubuntu下chrome无法同步问题解决
- Ubuntu Linux使用体验
- 使用 GNOME 优化工具自定义 Linux 桌面的 10 种方法
- 以Ubuntu 9.04为例 将工作环境迁移到 Linux
- VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹
- 从USB安装Ubuntu Server 10.04.3 图文详解
- Ubuntu 15.04 正式版发布下载
- Linux-Ubuntu 10.04安装Cadence-ic610 方法总结图解
- Windows Clang开发环境备忘
- Ubuntu 12.04和Windows 7双系统安装图解
- 开机出现:grub rescue的修复方法
- Ubuntu连接Android真机调试
- 你应该选择 Ubuntu 还是 Fedora?
- 100 个最佳 Ubuntu 应用(中)
- 看看我的Ubuntu Linux截图
- Ubuntu 12.04 LTS服务器版安装过程及使用图解