Redis编译安装过程问题

jemalloc/jemalloc.h

1
2
3
4
5
6
7
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-stable/src'
make: *** [all] Error 2

执行以下命令:

1
2
make distclean
make

如果问题未解决则使用以下命令再试:

1
make MALLOC=libc

tcl 8.5

1
2
3
4
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] Error 1
make[1]: Leaving directory `/home/redis/redis-stable/src'
make: *** [test] Error 2

下载Active State。此处下载二进制包“ActiveTcl-8.6.11.1.0000-x86_64-linux-glibc-2.17-e4e2f327.tar.gz”。安装过程:

1
2
3
4
tar xzvf ActiveTcl-8.6.11.1.0000-x86_64-linux-glibc-2.17-e4e2f327.tar.gz
mv ActiveTcl-8.6.11.1.0000-x86_64-linux-glibc-2.17-e4e2f327 ActiveTcl-8.6
cd ActiveTcl-8.6
./install.sh

根据提示输入完成安装过程。将Tcl8.6加入Path中,将以下内容添加至/etc/profile.d/tcl.sh:

1
2
export TCL_HOME=/opt/ActiveTcl-8.6
export PATH=$TCL_HOME/bin:$PATH

执行以下命令加载环境变量:

1
source /etc/profile

安装完成后,在我的环境里面仍然提示上面的错误。查看runtest脚本源码,并使用which命令验证才发现是我的Docker环境中没有安装which命令。-_-||

所以,一言不合就撸源代码是一个好习惯(* ̄︶ ̄)

release.h

1
2
3
4
5
release.c:37:21: fatal error: release.h: No such file or directory
#include "release.h"
^
compilation terminated.
make[1]: *** [release.o] Error 1

竟然是因为下面的脚本没有权限导致的。遇到问题仔细检查Log的重要性啊!!

1
2
3
4
cd src && make all
sh: ./mkreleasehdr.sh: Permission denied
make[1]: Entering directory `/home/redis/redis-6.2.6/src'
CC Makefile.dep