1.在安装redis出现下列错误
[root@node1 redis]# make
cd src && make all
make[1]: Entering directory `/usr/local/redis/src'
CC adlist.o
在包含自 adlist.c:34 的文件中:
zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录
zmalloc.h:55:2: 错误:#error "Newer version of jemalloc required"
make[1]: *** [adlist.o] 错误 1
make[1]: Leaving directory `/usr/local/redis/src'
make: *** [all] 错误 2
解决方法:
[root@node1 redis]# make MALLOC=libc
cd src && make all
make[1]: Entering directory `/usr/local/redis/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: Entering directory `/usr/local/redis/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/usr/local/redis/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic >> .make-settings
echo WARN=-Wall >> .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 -Wall -O2 -g -ggdb -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)
make[2]: Entering directory `/usr/local/redis/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-ldflags)
(echo "" > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/usr/local/redis/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[3]: Leaving directory `/usr/local/redis/deps/hiredis'
MAKE linenoise
cd linenoise && make
make[3]: Entering directory `/usr/local/redis/deps/linenoise'
cc -Wall -Os -g -c linenoise.c
make[3]: Leaving directory `/usr/local/redis/deps/linenoise'
MAKE lua
cd lua/src && make all CFLAGS="-O2 -Wall -DLUA_ANSI " MYLDFLAGS=""
make[3]: Entering directory `/usr/local/redis/deps/lua/src'
cc -O2 -Wall -DLUA_ANSI -c -o lapi.o lapi.c
cc -O2 -Wall -DLUA_ANSI -c -o lcode.o lcode.c
cc -O2 -Wall -DLUA_ANSI -c -o ldebug.o ldebug.c
cc -O2 -Wall -DLUA_ANSI -c -o ldo.o ldo.c
cc -O2 -Wall -DLUA_ANSI -c -o ldump.o ldump.c
cc -O2 -Wall -DLUA_ANSI -c -o lfunc.o lfunc.c
cc -O2 -Wall -DLUA_ANSI -c -o lgc.o lgc.c
cc -O2 -Wall -DLUA_ANSI -c -o llex.o llex.c
cc -O2 -Wall -DLUA_ANSI -c -o lmem.o lmem.c
cc -O2 -Wall -DLUA_ANSI -c -o lobject.o lobject.c
cc -O2 -Wall -DLUA_ANSI -c -o lopcodes.o lopcodes.c
cc -O2 -Wall -DLUA_ANSI -c -o lparser.o lparser.c
cc -O2 -Wall -DLUA_ANSI -c -o lstate.o lstate.c
cc -O2 -Wall -DLUA_ANSI -c -o lstring.o lstring.c
cc -O2 -Wall -DLUA_ANSI -c -o ltable.o ltable.c
cc -O2 -Wall -DLUA_ANSI -c -o ltm.o ltm.c
cc -O2 -Wall -DLUA_ANSI -c -o lundump.o lundump.c
cc -O2 -Wall -DLUA_ANSI -c -o lvm.o lvm.c
cc -O2 -Wall -DLUA_ANSI -c -o lzio.o lzio.c
cc -O2 -Wall -DLUA_ANSI -c -o strbuf.o strbuf.c
cc -O2 -Wall -DLUA_ANSI -c -o lauxlib.o lauxlib.c
cc -O2 -Wall -DLUA_ANSI -c -o lbaselib.o lbaselib.c
cc -O2 -Wall -DLUA_ANSI -c -o ldblib.o ldblib.c
cc -O2 -Wall -DLUA_ANSI -c -o liolib.o liolib.c
cc -O2 -Wall -DLUA_ANSI -c -o lmathlib.o lmathlib.c
cc -O2 -Wall -DLUA_ANSI -c -o loslib.o loslib.c
cc -O2 -Wall -DLUA_ANSI -c -o ltablib.o ltablib.c
cc -O2 -Wall -DLUA_ANSI -c -o lstrlib.o lstrlib.c
cc -O2 -Wall -DLUA_ANSI -c -o loadlib.o loadlib.c
cc -O2 -Wall -DLUA_ANSI -c -o linit.o linit.c
cc -O2 -Wall -DLUA_ANSI -c -o lua_cjson.o lua_cjson.c
cc -O2 -Wall -DLUA_ANSI -c -o lua_struct.o lua_struct.c
cc -O2 -Wall -DLUA_ANSI -c -o lua_cmsgpack.o lua_cmsgpack.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o strbuf.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o lua_cjson.o lua_struct.o lua_cmsgpack.o # DLL needs all object files
ranlib liblua.a
cc -O2 -Wall -DLUA_ANSI -c -o lua.o lua.c
cc -o lua lua.o liblua.a -lm
liblua.a(loslib.o): In function `os_tmpname':
loslib.c:(.text+0x35): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
cc -O2 -Wall -DLUA_ANSI -c -o luac.o luac.c
cc -O2 -Wall -DLUA_ANSI -c -o print.o print.c
cc -o luac luac.o print.o liblua.a -lm
make[3]: Leaving directory `/usr/local/redis/deps/lua/src'
make[2]: Leaving directory `/usr/local/redis/deps'
CC adlist.o
CC ae.o
CC anet.o
anet.c: 在函数‘anetSockName’中:
anet.c:559: 警告:dereferencing pointer ‘s’ does break strict-aliasing rules
anet.c:557: 附注:initialized from here
anet.c:563: 警告:dereferencing pointer ‘s’ does break strict-aliasing rules
anet.c:561: 附注:initialized from here
anet.c: 在函数‘anetPeerToString’中:
anet.c:537: 警告:dereferencing pointer ‘s’ does break strict-aliasing rules
anet.c:535: 附注:initialized from here
anet.c:541: 警告:dereferencing pointer ‘s’ does break strict-aliasing rules
anet.c:539: 附注:initialized from here
anet.c: 在函数‘anetTcpAccept’中:
anet.c:505: 警告:dereferencing pointer ‘s’ does break strict-aliasing rules
anet.c:503: 附注:initialized from here
anet.c:509: 警告:dereferencing pointer ‘s’ does break strict-aliasing rules
anet.c:507: 附注:initialized from here
CC dict.o
CC redis.o
CC sds.o
CC zmalloc.o
CC lzf_c.o
CC lzf_d.o
CC pqsort.o
CC zipmap.o
CC sha1.o
CC ziplist.o
CC release.o
CC networking.o
CC util.o
CC object.o
CC db.o
db.c: 在函数‘scanGenericCommand’中:
db.c:390: 警告:此函数中的‘pat’在使用前可能未初始化
db.c:391: 警告:此函数中的‘patlen’在使用前可能未初始化
CC replication.o
CC rdb.o
CC t_string.o
CC t_list.o
CC t_set.o
CC t_zset.o
CC t_hash.o
CC config.o
CC aof.o
CC pubsub.o
CC multi.o
CC debug.o
CC sort.o
CC intset.o
CC syncio.o
CC cluster.o
CC crc16.o
CC endianconv.o
CC slowlog.o
CC scripting.o
CC bio.o
CC rio.o
CC rand.o
CC memtest.o
CC crc64.o
CC bitops.o
CC sentinel.o
CC notify.o
CC setproctitle.o
CC blocked.o
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
CC redis-check-dump.o
LINK redis-check-dump
CC redis-check-aof.o
LINK redis-check-aof
Hint: To run 'make test' is a good idea ;)
make[1]: Leaving directory `/usr/local/redis/src'