memcached2.6.14安装

废话不多说,直接上过程:

系统(centos5.5 32bit):

[root@localhost packer]# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description:    CentOS release 5.5 (Final)
Release:    5.5
Codename:   Final

步骤:

tar -zxvf redis-2.6.14.tar.gz
cd redis-2.6.14
make PREFIX=/usr/local/redis-2.6.14 install //指定安装目录
make test


当执行到第三步时候,会报错类似:

zmalloc.o: In function `zmalloc_used_memory':
/opt/redis-2.6.7/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/var/opt/redis-2.6.7/src'
make: *** [all] Error 2


解决方法:

[root@devvm1 redis-2.6.7]# uname -m i686
[root@devvm1 redis-2.6.7]# export CFLAGS=-march=i686
[root@devvm1 redis-2.6.7]# make distclean
[root@devvm1 redis-2.6.7]# make PREFIX=/usr/local/redis-2.6.14 install


当执行到第四步时候报错类似:

You need 'tclsh8.5' in order to run the Redis test
make[1]: *** [test] Error 1
make[1]: Leaving directory `/usr/local/redis-2.6.14/src'
make: *** [test] Error 2


解决方法:

wget http://downloads.sourceforge.net/tcl/tcl8.5.12-src.tar.gz
tar -zxvf tcl8.5.12-src.tar.gz
cd tcl8.5.12-src/unix
./configure
make && make install