編譯redis時:make cc Command not found
yum install gcc
編譯redis時:error: jemalloc/jemalloc.h: No such file or directory
原因分析:gcc在這里是作為c語言編譯器編譯redis的(當然現在已經發展成為多種語言的編譯器),說到c語言一般都會想到那些.h的頭文件,這些頭文件里面包含了MALLOC這個環境變量並且MALLOC=jemalloc,然后我們再來看看redis的說明文件README.md,可以發現以下這段話:
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
現在錯誤的原因和解決辦法已經顯現出來了,執行
make MALLOC=libc
問題解決
轉載請注明博客出處:http://www.cnblogs.com/cjh-notes/