<p>本文为大家讲解的是Redis 2.8.18 安装报错 error: jemalloc/jemalloc.h: No such file or directory解决方法,感兴趣的同学参考下。</p><p>错误描述</p><p>安装Redis 2.8.18时报错:</p><p>zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory</p><p>zmalloc.h:55:2: error: #error &quot;Newer version of jemalloc required&quot;</p><p>make[1]: *** [adlist.o] Error 1</p><p>make[1]: Leaving directory `/data0/src/redis-2.6.2/src&#39;</p><p>make: *** [all] Error 2</p><p>原因分析</p><p>在README 有这个一段话。</p><p>Allocator </p><p>--------- </p><p></p><p>Selecting a non-default memory allocator when building Redis is done by setting </p><p>the `MALLOC` environment variable. Redis is compiled and linked against libc </p><p>malloc by default, with the exception of jemalloc being the default on Linux </p><p>systems. This default was picked because jemalloc has proven to have fewer </p><p>fragmentation problems than libc malloc. </p><p></p><p>To force compiling against libc malloc, use: </p><p></p><p> % make MALLOC=libc </p><p></p><p>To compile against jemalloc on Mac OS X systems, use: </p><p></p><p> % make MALLOC=jemalloc</p><p>说关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。</p><p>而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。</p><p>但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数。</p><p>解决办法</p><p>make MALLOC=libc</p>
T:0.027335s,M:245.83 KB
返回顶部 留言