centos7編譯安裝redis遇坑


編譯redis時:make cc Command not found

原因分析:沒有安裝gcc,執行:
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/

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM