一. 安装libevent
二. 安装memcached.
编译 memcached
1. 下载memcached-1.4.24.tar.gz
$ tar zxvf memcached-1.4.24.tar.gz
$ cd memcached-1.4.24
$ ./configure --prefix=$HOME/memcached
$ make
遇到错误,提示libevent的安装路径,
重新执行 ./configure --prefix=$HOME/memcached --with-libevent=$HOME/libevent
$ make
还是出错,编译某个.o文件出错,
下载memcached-1.4.20 ,按照上面步骤重新编译,顺利通过,
最后执行 $ make install
安装完成。
三 安装libmemcached
下载pylibmc
编译 libmemcached
$ ./configure --prefix=/home/afauat/libmemcached
$make
..............
CXX libhashkit/libhashkit_libhashkit_la-rijndael.lo
CXX libhashkit/libhashkit_libhashkit_la-str_algorithm.lo
CXX libhashkit/libhashkit_libhashkit_la-strerror.lo
CXX libhashkit/libhashkit_libhashkit_la-string.lo
CXX libhashkit/libhashkit_libhashkit_la-nohsieh.lo
CXXLD libhashkit/libhashkit.la
CXX libmemcached/csl/libmemcached_libmemcached_la-context.lo
在包含自 ./libmemcached/common.h:114 的文件中,
从 ./libmemcached/csl/common.h:50,
从 libmemcached/csl/context.cc:38:
./libmemcached-1.0/memcached.h:46:23: 错误:cinttypes:没有那个文件或目录
make[1]: *** [libmemcached/csl/libmemcached_libmemcached_la-context.lo] 错误 1
make[1]: Leaving directory `/home/afauat/soft_collection/memcached/libmemcached-1.0.18'
make: *** [all] 错误 2
[afauat:/home/afauat/soft_collection/memcached/libmemcached-1.0.18]
原因 貌似是gcc版本过低了
解决方法,安装高版本gcc
export CC=/usr/bin/gcc4.8.2
export CXX=/usr/bin/g++4.8.2
安装 libmemcached 成功。
四 安装pylibmc
$ python setup.py install
安装pylibmc报错,
加上libmemcached的include与lib路径,安装通过。
五 pylilbmc 的使用参考
阅读(1017) | 评论(0) | 转发(0) |