redis 編譯安裝問題記錄

redis 編譯安裝過程中出現問題彙總:
通過解壓方式安裝,tar -zvxf redis-3.2.9.tar.gz
進入 解壓後的文件目錄,如下
cd /home/redis-3.2.9/
進行編譯安裝,在編譯安裝過程中出現如下錯誤:
[root@localhost redis-3.2.9]# make
cd src && make all
make[1]: 進入目錄“/home/redis-3.2.9/src”
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: 致命錯誤:jemalloc/jemalloc.h:沒有那個文件或目錄
#include <jemalloc/jemalloc.h>
^
編譯中斷。
make[1]: [adlist.o] 錯誤 1
make[1]: 離開目錄“/home/redis-3.2.9/src”
make:
[all] 錯誤 2

這時使用make MALLOC=libc,進行安裝:
root@localhost src]#make MALLOC=libc
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof .o .gcda .gcno .gcov redis.info lcov-html
(cd ../deps && make distclean)
make[1]: 進入目錄“/home/redis-3.2.9/deps”
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-)
make[1]: 離開目錄“/home/redis-3.2.9/deps”
(rm -f .make-
)
echo STD=-std=c99 -pedantic -DREDIS_STATIC= >> .make-settings
echo WARN=-Wall -W >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=libc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC= -Wall -W -O2 -g -ggdb -I../deps/geohash-int -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src >> .make-settings
echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua geohash-int)
make[1]: 進入目錄“/home/redis-3.2.9/deps”
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[2]: 進入目錄“/home/redis-3.2.9/deps/hiredis”
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb sds.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb async.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o
make[2]: 離開目錄“/home/redis-3.2.9/deps/hiredis”
.
.
.
.
CC redis-benchmark.o
LINK redis-benchmark
INSTALL redis-check-rdb
CC redis-check-aof.o
LINK redis-check-aof

Hint: It's a good idea to run 'make test' ;)

安裝好後,進入src目錄下,make test,報You need tcl 8.5 or newer in order to run the Redis test,然後安裝tcl,如果可以在線安裝就在線安裝,如果不行同樣下載對應需要安裝版本tcl 8.5 tar包進行安裝。
root@localhost redis-3.2.9]# make test
cd src && make test
make[1]: 進入目錄“/home/redis-3.2.9/src”
You need tcl 8.5 or newer in order to run the Redis test
make[1]: [test] 錯誤 1
make[1]: 離開目錄“/home/redis-3.2.9/src”
make:
[test] 錯誤 2

[root@localhost redis-3.2.9]# yum install tcl
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: mirrors.cn99.com
  • epel: mirrors.aliyun.com
  • extras: mirrors.njupt.edu.cn
  • updates: mirrors.cn99.com
    正在解決依賴關係
    --> 正在檢查事務

完畢!
[root@localhost redis-3.2.9]# make test
cd src && make test
make[1]: 進入目錄“/home/redis-3.2.9/src”
Cleanup: may take some time... OK
Starting test server at port 11111

Testing unit/printver
.
.
.
.
106 seconds - integration/replication-psync

\o/ All tests passed without errors!

Cleanup: may take some time... OK
make[1]: 離開目錄“/home/redis-3.2.9/src”

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章