作者:13486099491_fb9570 | 来源:互联网 | 2023-09-04 23:38
ot@DESKTOP-5382063:usrlocalredisredis-3.0.4#make\>cdsrc&&am
ot@DESKTOP-5382063:/usr/local/redis/redis-3.0.4# make\
>
cd src && make all
make[1]: Entering directory '/usr/local/redis/redis-3.0.4/src'
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
#include
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:197: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory '/usr/local/redis/redis-3.0.4/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
以上10错误是进入redis安装目录出现编译失败的情况,有可能出现上次编译残留,make distclean命令进行清理,make&&make install命令进行编译安装
ubandu
初次安装redis会出现:安装redis时 提示执行make命令时提示 CC adlist.o /bin/sh: cc: 未找到命令。是因为redis是c语言言写的需要c的运行库需要安装。
执行:sudo apt-get build-dep gcc或者apt install gcc命令
安装成功后测试命令make test出现如下错误:make[1]: Entering directory '/usr/local/redis/redis-3.0.4/src' You need tcl 8.5 or newer in order to run the Redis test Makefile:211: recipe for target 'test' failed make[1]: *** [test] Error 1 make[1]: Leaving directory '/usr/local/redis/redis-3.0.4/src' Makefile:6: recipe for target 'test' failed make: *** [test] Error 2
解决方案:wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/
cd /usr/local/tcl8.6.1/unix/
sudo ./configure
sudo make
sudo make install