编译redis安装的时候报错如下:
make[1]: [persist-settings] Error 2 (ignored)
CC adlist.o/bin/sh: cc: command not foundmake[1]: *** [adlist.o] Error 127make[1]: Leaving directory `/etc/yum.repos.d/redis-4.0.1/src'make: *** [all] Error 2[root@localhost redis-4.0.1]# make cd src && make allmake[1]: Entering directory `/etc/yum.repos.d/redis-4.0.1/src' CC Makefile.depmake[1]: Leaving directory `/etc/yum.repos.d/redis-4.0.1/src'make[1]: Entering directory `/etc/yum.repos.d/redis-4.0.1/src' CC adlist.o/bin/sh: cc: command not foundmake[1]: *** [adlist.o] Error 127make[1]: Leaving directory `/etc/yum.repos.d/redis-4.0.1/src'make: *** [all] Error 2[root@localhost redis-4.0.1]# make cd src && make allmake[1]: Entering directory `/etc/yum.repos.d/redis-4.0.1/src' CC adlist.o/bin/sh: cc: command not foundmake[1]: *** [adlist.o] Error 127make[1]: Leaving directory `/etc/yum.repos.d/redis-4.0.1/src'make: *** [all] Error 2
解决:
1./bin/sh: cc: command not found 错误是因为一些依赖包未安装
yum -y install gcc gcc-c++ libstdc++-devel 解决
2.zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h:
make MALLOC=libc 解决