redis—fatal error: jemalloc/jemalloc.h: No such file or directo

453 阅读1分钟

版本信息

内核:Linux 300c013c6985 4.19.121-linuxkit #1 SMP Tue Dec 1 17:50:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Centos:CentOS Linux release 7.9.2009 (Core)
redis: redis-3.0.0

错误描述

[root@300c013c6985 redis-3.0.0]# make
cd src && make all
make[1]: Entering directory `/data/install/redis-3.0.0/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 `/data/install/redis-3.0.0/src'
make: *** [all] Error 2

README

Fixing build problems with dependencies or cached build options
—--------
Redis has some dependencies which are included into the "deps" directory.
"make" does not rebuild dependencies automatically, even if something in the
source code of dependencies is changes.

When you update the source code with `git pull` or when code inside the
dependencies tree is modified in any other way, make sure to use the following
command in order to really clean everything and rebuild from scratch:

    make distclean

This will clean: jemalloc, lua, hiredis, linenoise.

Also if you force certain build options like 32bit target, no C compiler
optimizations (for debugging purposes), and other similar build time options,
those options are cached indefinitely until you issue a "make distclean"
command.

问题原因

看上面的README文件,主要的问题就是“"make" does not rebuild dependencies automatically” make命令不会重新自动构建依赖

解决方案

make distclean
执行make distclean 进行一下清理动作