redis编译报致命错误:jemalloc/jemalloc.h:没有那个文件或目录
分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。
而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。
但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数,运行如下命令:
make MALLOC=libc
如果make的时候提示如下错误:
cc: error: ../deps/hiredis/libhiredis.a: No such file or directory
cc: error: ../deps/lua/src/liblua.a: No such file or directory
cc: error: ../deps/jemalloc/lib/libjemalloc.a: No such file or directory
make: *** [redis-server] Error 1
则进入redis下的deps下的运行如下命令,就OK了。
make lua hiredis linenoise
本文详细介绍了在编译Redis时遇到jemalloc.h文件缺失及依赖库找不到等常见错误的解决办法,通过设置MALLOC环境变量为libc并执行特定命令,帮助读者轻松解决编译难题。
2100

被折叠的 条评论
为什么被折叠?



