搭建KLEE环境步骤以及注意事项

本文详细记录了在Ubuntu环境下安装配置LLVM及LLVM-GCC的过程,包括解决依赖问题、环境变量设置、参数配置等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、版本们:llvm(2.9);llvm-gcc(直接下llvm 2.9 对应的binaries版本);gcc(4.7,至少我是在这个版本上成功的);

2、 while making llvm, remember to include <unistd.h> in /home/qingjinlyc/IDEs/llvm-2.9/lib/ExecutionEngine/JIT/Intercept.c/bin/sh:pp IF you`re unsing gcc 4.7
    also, before build llvm,  remember  to add llvm-gcc to your PATH!!!!
3. remember to specify following parameters after configure for llvm-gcc: --disable-threads --disable-nls --disable-shared --enable-languages=c,c++ --disable-c-mbchar --program-prefix=llvm- --enable-llvm=/usr/build/llvm  ( I strongly recommend use binaries of llvm-gcc directly!!!)

4. 要想build release版本的llvm,在configure的时候加参数--enable-optimized( It is recommended because klee is slow with debug version of llvm)

5. 一定一定记得加环境变量  C_INCLUDE_PATH=/usr/include/i386-linux-gnu/( But check /usr/include first, to make sure whether some of the hearders files needed is in /usr/inculde/i386-linux-gnu)

6. 一定一定记住:在 llvm-gcc源代码目录平级的目录下建立存放目标文件的文件夹!!!!!! ( Again, I strongly recommend use binaries of llvm-gcc directly!!!)

7. When configure klee with option --with-stp=path/to/stp, you may got error like 'cannot use stp/c_interface.h', which is the consequence of stp didn`t place its headers file in the place(/usr/include/stp) where klee expects. So, just cp the needed header files to the right possition.

(2013年2月23日,在实验室的PC上装LLVM-GCC时候,老是报错configure: error: C compiler cannot create executables。搞了好长时间,查了好多资料,几乎快疯了
,后来试着修改LIBRARY_PATH=/usr/lib:/usr/lib/i386-linux-gnu,就可以了。不知道为什么,因为在笔记本上做时,并没有改LIBRARY_PATH啊)

为什么ubuntu 12.04的include都放在/usr/include/i386-linux-gnu里面呢,而很多程序都是到/usr/include里面找的

问题是,build LLVM需要llvm-gcc,好,但是,build LLVM-GCC的时候又要llvm,这不是死锁了嘛!
尝试:
1、不要最后一个参数——不行。
2、先不要--with-llvmgcc和--with-llvmg++来build llvm——


回到寝室看笔记本上搭的环境,瞬间明白了——笔记本上用的llvm-gcc直接是Bin版的。明天去就这么搞。但是我不懂啊,实验室机器上那个tgz也是bin版的啊,为什么解压开来是那个鸟样??????

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值