intel / lmbench

GNU General Public License v2.0
265 stars 117 forks source link

fix compilation error 'fatal error: rpc/rpc.h: No such file or directory' #16

Open purplewall1206 opened 3 years ago

purplewall1206 commented 3 years ago

first replace #include <rpc/xxx> by #include <tirpc/rpc/xxx>

second and there are some problems in '/usr/include/tirpc/rpc' directory, cd into it , then

grep '#include <rpc' ./ -lr | xargs sed -i 's/#include <rpc\//#include <tirpc\/rpc\//g'

grep '#include <netconfig' ./ -lr | xargs sed -i 's/#include <netconfig.h>/#include \"..\/netconfig.h\"/g'

finally

make results LDFLAGS=-ltirpc

the problem will be fixed, tested successfully on manjaro 20

mimuyi commented 3 years ago

Centos8: modify the content of /usr/include/netdb.h file <rpc/netdb.h> => <tirpc/rpc/netdb.h>

gipi commented 1 year ago

I think is more correct to change the CFLAGS variable to point to the right include instead of modify the system headers.

diff --git a/src/Makefile b/src/Makefile
index 2555014..dcf3226 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -58,6 +58,8 @@ SAMPLES=lmbench/Results/aix/rs6000 lmbench/Results/hpux/snake \
        lmbench/Results/irix/indigo2 lmbench/Results/linux/pentium \
        lmbench/Results/osf1/alpha lmbench/Results/solaris/ss20* 

+CPPFLAGS:=$(CPPFLAGS) -I /usr/include/tirpc/
+
 COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)

 INCS = bench.h lib_mem.h lib_tcp.h lib_udp.h stats.h timing.h