在部署redis时,提示如下:
$ make
...
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
compilation terminated.
Makefile:317: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory '/opt/cici/redis/redis-6.0.8/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
推测应该是gcc没有安装。
$ sudo apt install gcc
报错依旧。
查了下资料,发现有可能原因是jemalloc重载了Linux下的ANSI C的malloc和free函数。
所以解决办法就有了:make时添加参数。
$ make MALLOC=libc
这时候则没有问题了。