编译安装redis报错zmalloc.h

来源:互联网 发布:网络打假教程 编辑:程序博客网 时间:2024/05/20 05:07

    • 问题
    • 解决方法
    • 问题原因

问题

编译安装redis时出现报错zmalloc.h

zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directoryzmalloc.h:55:2: error: #error "Newer version of jemalloc required"make[1]: *** [adlist.o] Error 1

解决方法

make MALLOC=libc

问题原因

查了下readme

Allocator---------Selecting a non-default memory allocator when building Redis is done by settingthe `MALLOC` environment variable. Redis is compiled and linked against libcmalloc by default, with the exception of jemalloc being the default on Linuxsystems. This default was picked because jemalloc has proven to have fewerfragmentation problems than libc malloc.To force compiling against libc malloc, use:    % make MALLOC=libcTo compile against jemalloc on Mac OS X systems, use:    % make MALLOC=jemalloc

大概意思是说redis编译时需要MALLOC,系统中默认的MALLOC环境变量是jemalloc ,但是当jemalloc 不存在的时候,就需要我们手动指定MALLOC指向libc

原创粉丝点击