libmemcachedインストール

提供: Wikiducca
移動: 案内検索

※最新版(1.0.5 以降)にする場合は末尾参照。


http://libmemcached.org/libMemcached.html

wget http://download.tangent.org/libmemcached-0.38.tar.gz
tar zxvf libmemcached-0.38.tar.gz
cd libmemcached-0.38
./configure
make
make install
/sbin/ldconfig


32bit OS の場合以下のようにしないとエラーになる。 (参考)

./configure -disable-64bit CFLAGS="-O3 -march=i686"

以下にインストールされる。

/usr/local/share/man/man1/memcapable.1
/usr/local/share/man/man1/memcat.1
/usr/local/share/man/man1/memcp.1
/usr/local/share/man/man1/memdump.1
/usr/local/share/man/man1/memerror.1
/usr/local/share/man/man1/memflush.1
/usr/local/share/man/man1/memrm.1
/usr/local/share/man/man1/memslap.1
/usr/local/share/man/man1/memstat.1
/usr/local/share/man/man3/hashkit_clone.3
/usr/local/share/man/man3/hashkit_crc32.3
/usr/local/share/man/man3/hashkit_create.3
/usr/local/share/man/man3/hashkit_fnv1_32.3
/usr/local/share/man/man3/hashkit_fnv1_64.3
/usr/local/share/man/man3/hashkit_fnv1a_32.3
/usr/local/share/man/man3/hashkit_fnv1a_64.3
/usr/local/share/man/man3/hashkit_free.3
/usr/local/share/man/man3/hashkit_functions.3
/usr/local/share/man/man3/hashkit_hsieh.3
/usr/local/share/man/man3/hashkit_is_allocated.3
/usr/local/share/man/man3/hashkit_jenkins.3
/usr/local/share/man/man3/hashkit_md5.3
/usr/local/share/man/man3/hashkit_murmur.3
/usr/local/share/man/man3/hashkit_value.3
/usr/local/share/man/man3/libmemcached.3
/usr/local/share/man/man3/libmemcached_examples.3
/usr/local/share/man/man3/libmemcachedutil.3
/usr/local/share/man/man3/memcached_add.3
/usr/local/share/man/man3/memcached_add_by_key.3
/usr/local/share/man/man3/memcached_analyze.3
/usr/local/share/man/man3/memcached_append.3
/usr/local/share/man/man3/memcached_append_by_key.3
/usr/local/share/man/man3/memcached_behavior_get.3
/usr/local/share/man/man3/memcached_behavior_set.3
/usr/local/share/man/man3/memcached_callback_get.3
/usr/local/share/man/man3/memcached_callback_set.3
/usr/local/share/man/man3/memcached_cas.3
/usr/local/share/man/man3/memcached_cas_by_key.3
/usr/local/share/man/man3/memcached_clone.3
/usr/local/share/man/man3/memcached_create.3
/usr/local/share/man/man3/memcached_decrement.3
/usr/local/share/man/man3/memcached_decrement_with_initial.3
/usr/local/share/man/man3/memcached_delete.3
/usr/local/share/man/man3/memcached_delete_by_key.3
/usr/local/share/man/man3/memcached_dump.3
/usr/local/share/man/man3/memcached_fetch.3
/usr/local/share/man/man3/memcached_fetch_execute.3
/usr/local/share/man/man3/memcached_fetch_result.3
/usr/local/share/man/man3/memcached_flush_buffers.3
/usr/local/share/man/man3/memcached_free.3
/usr/local/share/man/man3/memcached_generate_hash_value.3
/usr/local/share/man/man3/memcached_get.3
/usr/local/share/man/man3/memcached_get_by_key.3
/usr/local/share/man/man3/memcached_get_memory_allocators.3
/usr/local/share/man/man3/memcached_get_user_data.3
/usr/local/share/man/man3/memcached_increment.3
/usr/local/share/man/man3/memcached_increment_with_initial.3
/usr/local/share/man/man3/memcached_lib_version.3
/usr/local/share/man/man3/memcached_mget.3
/usr/local/share/man/man3/memcached_mget_by_key.3
/usr/local/share/man/man3/memcached_mget_execute.3
/usr/local/share/man/man3/memcached_mget_execute_by_key.3
/usr/local/share/man/man3/memcached_pool_behavior_get.3
/usr/local/share/man/man3/memcached_pool_behavior_set.3
/usr/local/share/man/man3/memcached_pool_create.3
/usr/local/share/man/man3/memcached_pool_destroy.3
/usr/local/share/man/man3/memcached_pool_pop.3
/usr/local/share/man/man3/memcached_pool_push.3
/usr/local/share/man/man3/memcached_prepend.3
/usr/local/share/man/man3/memcached_prepend_by_key.3
/usr/local/share/man/man3/memcached_quit.3
/usr/local/share/man/man3/memcached_replace.3
/usr/local/share/man/man3/memcached_replace_by_key.3
/usr/local/share/man/man3/memcached_server_add.3
/usr/local/share/man/man3/memcached_server_count.3
/usr/local/share/man/man3/memcached_server_cursor.3
/usr/local/share/man/man3/memcached_server_list.3
/usr/local/share/man/man3/memcached_server_list_append.3
/usr/local/share/man/man3/memcached_server_list_count.3
/usr/local/share/man/man3/memcached_server_list_free.3
/usr/local/share/man/man3/memcached_server_push.3
/usr/local/share/man/man3/memcached_servers_parse.3
/usr/local/share/man/man3/memcached_set.3
/usr/local/share/man/man3/memcached_set_by_key.3
/usr/local/share/man/man3/memcached_set_memory_allocators.3
/usr/local/share/man/man3/memcached_set_user_data.3
/usr/local/share/man/man3/memcached_stat.3
/usr/local/share/man/man3/memcached_stat_get_keys.3
/usr/local/share/man/man3/memcached_stat_get_value.3
/usr/local/share/man/man3/memcached_stat_servername.3
/usr/local/share/man/man3/memcached_strerror.3
/usr/local/share/man/man3/memcached_verbosity.3
/usr/local/share/man/man3/memcached_version.3
/usr/local/lib/pkgconfig/libmemcached.pc
/usr/local/lib/libhashkit.la
/usr/local/lib/libhashkit.so -> libhashkit.so.0.0.0
/usr/local/lib/libhashkit.so.0 -> libhashkit.so.0.0.0
/usr/local/lib/libhashkit.so.0.0.0
/usr/local/lib/libmemcached.la
/usr/local/lib/libmemcached.so -> libmemcached.so.4.0.0
/usr/local/lib/libmemcached.so.4 -> libmemcached.so.4.0.0
/usr/local/lib/libmemcached.so.4.0.0
/usr/local/lib/libmemcachedprotocol.la
/usr/local/lib/libmemcachedprotocol.so -> libmemcachedprotocol.so.0.0.0
/usr/local/lib/libmemcachedprotocol.so.0 -> libmemcachedprotocol.so.0.0.0
/usr/local/lib/libmemcachedprotocol.so.0.0.0
/usr/local/lib/libmemcachedutil.la
/usr/local/lib/libmemcachedutil.so -> libmemcachedutil.so.0.0.0
/usr/local/lib/libmemcachedutil.so.0 -> libmemcachedutil.so.0.0.0
/usr/local/lib/libmemcachedutil.so.0.0.0
/usr/local/include/libhashkit/algorithm.h
/usr/local/include/libhashkit/behavior.h
/usr/local/include/libhashkit/hashkit.h
/usr/local/include/libhashkit/strerror.h
/usr/local/include/libhashkit/types.h
/usr/local/include/libhashkit/visibility.h
/usr/local/include/libmemcached/analyze.h
/usr/local/include/libmemcached/auto.h
/usr/local/include/libmemcached/behavior.h
/usr/local/include/libmemcached/callback.h
/usr/local/include/libmemcached/configure.h
/usr/local/include/libmemcached/constants.h
/usr/local/include/libmemcached/dump.h
/usr/local/include/libmemcached/exception.hpp
/usr/local/include/libmemcached/get.h
/usr/local/include/libmemcached/memcached.h
/usr/local/include/libmemcached/memcached.hpp
/usr/local/include/libmemcached/memcached_util.h
/usr/local/include/libmemcached/protocol_handler.h
/usr/local/include/libmemcached/result.h
/usr/local/include/libmemcached/server.h
/usr/local/include/libmemcached/stats.h
/usr/local/include/libmemcached/storage.h
/usr/local/include/libmemcached/string.h
/usr/local/include/libmemcached/types.h
/usr/local/include/libmemcached/visibility.h
/usr/local/include/libmemcached/watchpoint.h
/usr/local/include/libmemcached/memcached/protocol_binary.h
/usr/local/include/libmemcached/protocol/cache.h
/usr/local/include/libmemcached/protocol/callback.h
/usr/local/include/libmemcached/util/pool.h
/usr/local/bin/memcapable
/usr/local/bin/memcat
/usr/local/bin/memcp
/usr/local/bin/memdump
/usr/local/bin/memerror
/usr/local/bin/memflush
/usr/local/bin/memrm
/usr/local/bin/memslap
/usr/local/bin/memstat


CentOS5 に最新バージョン 1.X をインストールする際の注意点

CentOS5 は gcc のバージョンが古いため、libmemcached 1.0.5 以降の make でエラーになる。

エラー内容

make  all-am
make[1]: ディレクトリ `/usr/local/src/memcached/libmemcached-1.0.7' に入ります
  CXX    libmemcached/libmemcached_libmemcached_la-auto.lo
libmemcached/auto.cc: In function 'memcached_return_t text_incr_decr(memcached_server_st*, bool, const char*, size_t, uint64_t, bool)':
libmemcached/auto.cc:73: error: expected `)' before 'PRIu64'
make[1]: *** [libmemcached/libmemcached_libmemcached_la-auto.lo] エラー 1
make[1]: ディレクトリ `/usr/local/src/memcached/libmemcached-1.0.7' から出ます
make: *** [all] エラー 2

または、

          〜 省 略 〜
In file included from ./libmemcached/common.h:72,
                 from ./libmemcached/csl/common.h:40,
                 from libmemcached/csl/context.cc:38:
./libmemcached-1.0/memcached.h:46:27: error: tr1/cinttypes: No such file or directory
make[1]: *** [libmemcached/csl/libmemcached_libmemcached_la-context.lo] エラー 1
make[1]: ディレクトリ `/usr/local/src/memcached/libmemcached-1.0.8' から出ます
make: *** [all] エラー 2


対策

1) 1.0.4 までならエラーは出ないので、それを使う。

2) gcc44 を入れる。

# yum install gcc44 gcc44-c++ libstdc++44-devel
# export CC=/usr/bin/gcc44
# export CXX=/usr/bin/g++44
# ./configure

参考: http://www.bxtra.net/comment/3660