- 安装redis 5.0之后的版本
先安装gcc:yum -y install gcc
- 进入redis项目目录之后make,报错:jemalloc/jemalloc.h: No such file or directory
[root@localhost redis-5.0.3]# make
cd src && make all
make[1]: Entering directory `/home/redis/redis-5.0.3/src'
CC Makefile.dep
make[1]: Leaving directory `/home/redis/redis-5.0.3/src'
make[1]: Entering directory `/home/redis/redis-5.0.3/src'
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
#include <jemalloc/jemalloc.h>
^
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/redis/redis-5.0.3/src'
make: *** [all] Error 2
- 解决方法
原因是jemalloc重载了Linux下的ANSI C的malloc和free函数。解决办法:make时添加参数。
再次执行:
make MALLOC=libc
网友评论