火曜日, 3 月 02nd, 2010 | Author: djodjo

遅まきながらmemcachedを触りはじめました。
ところが、libmemcachedのコンパイルでつまづく。

clients/ms_conn.o: In function `ms_get_udp_request_id’:
/usr/local/src/libmemcached-0.38/clients/ms_conn.c:194: undefined reference to `__sync_fetch_and_add_4′
clients/ms_conn.o: In function `ms_reconn_socks’:
/usr/local/src/libmemcached-0.38/clients/ms_conn.c:1051: undefined reference to `__sync_fetch_and_add_4′
clients/ms_conn.o: In function `ms_reconn’:
/usr/local/src/libmemcached-0.38/clients/ms_conn.c:919: undefined reference to `__sync_fetch_and_add_4′
/usr/local/src/libmemcached-0.38/clients/ms_conn.c:956: undefined reference to `__sync_fetch_and_add_4′
clients/ms_thread.o: In function `ms_setup_thread’:
/usr/local/src/libmemcached-0.38/clients/ms_thread.c:225: undefined reference to `__sync_fetch_and_add_4′
clients/ms_thread.o:/usr/local/src/libmemcached-0.38/clients/ms_thread.c:208: more undefined references to `__sync_fetch_and_add_4′ follow
collect2: ld returned 1 exit status
make[2]: *** [clients/memslap] Error 1
make[2]: Leaving directory `/usr/local/src/libmemcached-0.38′
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/libmemcached-0.38′
make: *** [all] Error 2

どうも、__sync_fetch_and_add_4がないとか。何かリンクできていないのか。
とググってみると、libmemcachedではないけど、gccやglibなどのmakeではまっている方を発見。なるほど、ヒントがありました。
アーキテクチャの指定がきちんとできていないための模様。なので

export CFLAGS=”-march=i686″
./configure
make

これでOK!!!

Category: 未分類
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply