Redis 2.8.18 安装报错 error: jemalloc/jemalloc.h: No s
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
本文為大家講解的是Redis 2.8.18 安裝報(bào)錯(cuò) error: jemalloc/jemalloc.h: No such file or directory解決方法,感興趣的同學(xué)參考下。
錯(cuò)誤描述
安裝Redis 2.8.18時(shí)報(bào)錯(cuò):
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 `/data0/src/redis-2.6.2/src'
make: *** [all] Error 2
原因分析
在README 有這個(gè)一段話。
Allocator ?
--------- ?
?
Selecting a non-default memory allocator when building Redis is done by setting ?
the `MALLOC` environment variable. Redis is compiled and linked against libc ?
malloc by default, with the exception of jemalloc being the default on Linux ?
systems. This default was picked because jemalloc has proven to have fewer ?
fragmentation problems than libc malloc. ?
?
To force compiling against libc malloc, use: ?
?
??? % make MALLOC=libc ?
?
To compile against jemalloc on Mac OS X systems, use: ?
?
??? % make MALLOC=jemalloc
說(shuō)關(guān)于分配器allocator, 如果有MALLOC ?這個(gè) 環(huán)境變量, 會(huì)有用這個(gè)環(huán)境變量的 去建立Redis。
而且libc 并不是默認(rèn)的 分配器, 默認(rèn)的是 jemalloc, 因?yàn)?jemalloc 被證明 有更少的?fragmentation problems 比libc。
但是如果你又沒有jemalloc 而只有 libc 當(dāng)然 make 出錯(cuò)。 所以加這么一個(gè)參數(shù)。
解決辦法
make MALLOC=libc
轉(zhuǎn)載于:https://my.oschina.net/u/2356966/blog/469298
與50位技術(shù)專家面對(duì)面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的Redis 2.8.18 安装报错 error: jemalloc/jemalloc.h: No s的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 获取sql执行时间
- 下一篇: 原创跑酷小游戏《Cube Duck Ru