编译redis时报错zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:

如果有MALLOC这环境变量,会有用这个环境变量的去建立Redis。而且libc并不是默认的内存分配器, 默认是jemalloc,因为jemalloc被证明比libc有更少的fragmentation problems。但是如果没有jemalloc 而只有libc会make出错。所以解决方法有如下两种:

(1)指定参数:

make MALLOC=libc

(2)安装jemalloc:jemalloc干了malloc干的活,而且干得好一些,主要体现在避免内存碎片与并发扩展上。

  1. 下载jemalloc:

https://github.com/jemalloc/jemalloc/releases

2.编译安装:

./configure --prefix=/usr/local/jemalloc && make && make install

3.添加链接:

echo /usr/local/jemalloc/lib >> /etc/ld.so.conf

4.刷新库:

ldconfig

原文地址:http://blog.51cto.com/xvjunjie/2071671

时间: 2024-08-01 23:19:20

编译redis时报错zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:的相关文章

In file included from adlist.c:34:0: zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录

我报错是这样子的,然后老师打了一条命令[[email protected] redis-3.0.6]# makecd src && make allmake[1]: 进入目录"/root/lnmp_soft/redis-3.0.6/src"CC adlist.oIn file included from adlist.c:34:0:zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录#include <jemall

zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目

问题报错分析原因这个问题是关于分配器allocator, 如果有MALLOC ?这个 环境变量, 会有用这个环境变量的 去建立Redis.而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的?fragmentation problems 比libc.但是如果你又没有jemalloc 而只有 libc 当然 make 出错. 所以要指定分配器,加上参数了解决方案[[email protected] redis-2.8.17]# make MA

编译 redis 报错 error: jemalloc/jemalloc.h: No such file or directory

gcc编译redis时报错: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory zmalloc.h:55:2: error: #error "Newer version of jemalloc required" 原因是jemalloc重载了Linux下的ANSI C的malloc和free函数.解决办法:make时添加参数. make MALLOC=libc

redis make时 提示 zmalloc.h:50:31: error: jemalloc/jemalloc.h:

redis安装需要环境必备 gcc 但是若未先安装好gcc,make失败后再次 make 会提示如下错误 zmalloc.h:50:31: error: jemalloc/jemalloc.h: 这时候 需要执行make MALLOC=libc 即可完成编译

Xcode6编译SDWebImage报错原因分析(SDWebImageDownloaderOperation.m错误)

之前写了一片关于编译SDWebImage报错解决方法的文章: http://blog.csdn.net/cuibo1123/article/details/39434015 结果很多人问这个问题的原因,那就在这里给大家说一说好了,分析思路一并送上(不过我还是建议大家自己动手去分析). 首先,如果新建工程,按照SDWebImage的方式声明输出口并引用: @interface ZCTest () @property (assign, nonatomic, getter = isExecuting)

编译apache时报错

编译报错 checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures 原因:没装zlib-devel yum -y install zlib-devel

android 5.x system.img 大于2G导致编译otapackage时报错如何处理

当system分区预制过多apk时如果img size超过2G 在make otapackage时会报如下错误 zipfile.LargeZipFile: Zipfile size would require ZIP64 extensions 或 in writestr zinfo.CRC = crc32(bytes) & 0xffffffff # CRC-32 checksum OverflowError: size does not fit in an int //http://blog.c

Linux下安装过程中编译PHP时报错:configure: error: libjpeg.(a|so) not found

在Linux下安装PHP过程中,编译时出现configure: error: libjpeg.(a|so) not found 错误的解决的方法: 检查之后发现已经安装libjpeg.可是/usr/lib文件夹下没有libjpeg.so这个文件,在/usr/lib64下是有的,使用–with-jpeg-dir=/usr/lib64 依旧无效, 最后用ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so问题解决 libpng报错解决方法一样

Xcode6编译SDWebImage报错解决方法(SDWebImageDownloaderOperation.m错误)

报错:Use of undeclared identifier '_executing' / '_finished': 解决方法: 在SDWebImageDownloaderOperation类的实现中(@implementation里)添加: 1 @synthesize executing = _executing; 2 @synthesize finished = _finished; 即可.