使用 LLVM 16.0.4 编译 MiBench 中的 patricia遇到的 rpc 库问题
编译MiBench 中的 patricia 时,报如下错误
patricia_test.c:46:10: fatal error: 'rpc/rpc.h' file not found
#include <rpc/rpc.h>^~~~~~~~~~~
1 error generated.
DEBUG:execCmd: /root/SVF/llvm-16.0.4.obj/bin/clang [-O0 -Xclang -optnone -g -fno-discard-value-names -w -emit-llvm -c patricia_test.c -o .patricia_test.c.o.bc] had exitCode 1
DEBUG:execCmd: error was exit status 1
ERROR:Failed to build bitcode file for patricia_test.c because: exit status 1
DEBUG:Calling [gclang -static patricia.c patricia_test.c -O0 -Xclang -optnone -g -fno-discard-value-names -w -o patricia] returned 1
make: *** [Makefile:2:patricia] 错误 1
- 先装库
sudo apt-get update
sudo apt-get install libtirpc-dev
- 库文件本身有一些问题,切换到
/usr/include/tirpc
目录下 - 把
#include <rpc/rpc.h>
替换为#include <tirpc/rpc/rpc.h>
- 还有一些类似的 include 报错,逐个修改即可,有一个比较特殊的是把
#include <netconfig.h>
改为#include <tirpc/netconfig.h>