redis官网:http://redis.io

编译redis 2.6报错: zmalloc.o: In function zmalloc_used_memory’:

/home/xx/redis-2.6.2/src/zmalloc.c:223: undefined reference to__sync_add_and_fetch_4′

collect2: ld 返回 1

make[1]: *** [redis-server] 错误 1

make[1]: Leaving directory `/home/xx/redis-2.6.2/src’

make: *** [all] 错误 2

解决方法如下:

在src/Makefile开头加 CFLAGS= -march=i686

编辑src/.make-settings里的OPT,改为OPT=-O2 -march=i686。

Make 32bit,但是接下来又过不了,报错如下

You need ‘tclsh8.5′ in order to run the Redis test

需要tcl.

下载tcl8.5:

暂时tcl8.5无法成功安装,先不make test

补充: 运行 src/redis-server ,置于后台工作: src/redis-server &