CentOS7.5安装Redis问题:fatal error: jemalloc/jemalloc.h: No such file or directory

cd src && make all

make[1]: Entering directory `/root/redis-4.0.14/src’

CC Makefile.dep

make[1]: Leaving directory `/root/redis-4.0.14/src’

make[1]: Entering directory `/root/redis-4.0.14/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 `/root/redis-4.0.14/src’

make: *** [all] Error 2

上面抛出 jemalloc 的原因是 jemalloc 重载了 Linux 下的 ANSI C 的 malloc 和 free 函数。解决办法:make时添加参数,如下:

make MALLOC=libc

Leave a Reply

邮箱地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>