CentOS6.6 编译Redis报错:"Newer version of jemalloc required"

907 阅读1分钟

一、前言

  不同系统同一个问题,可能解决方法不一样,也可能会遇到不同的问题,所以具体情况具体分析,我的系统是Centos6.6, 查看系统命令 cat /etc/issue

测试6.7 也可以行。



二、安装redis后编译报错:Newer version of jemalloc required  (碰到这个问题)  

make MALLOC=libc 方法可行

复制代码
[root@server003-bmbic redis-5.0.3]# make
cd src && make all
make[1]: Entering directory `/usr/local/maple.yuan/redis-5.0.3/src'
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/redis-5.0.3/src'
make: *** [all] Error 2
复制代码

上面提示需要更新jemalloc,那么编译时可以指定编译库进行编译:

 make MALLOC=libc  该方法可行,指定编译时的编译库

编译成功之后,还需要install命令 才能生成bin目录

make PREFIX=/redis install


三、安装redis后编译报错:command not found make[1]

[root@server003-bmbic redis-5.0.3]# make
cd src && make all
make[1]: Entering directory `/root/redis-4.0.11
/src‘ CC adlist.o /bin/sh: cc: command not found make[1]: *** [adlist.o] Error 127 make[1]: Leaving directory `/root/redis-2.8.17/src‘ make: *** [all] Error 2

说明没有安装gcc或者make, 则可以使用命令安装:yum install -y gcc g++ gcc-c++ make, 然后再进行编译。

四、总结

以上是我执行过程中遇到的问题,记录总结下。以上问题可能还有另外的解决方式,如有大神使用并解决过,可以共享下。