awesomized / libmemcached

Resurrection of libmemcached
https://awesomized.github.io/libmemcached/
BSD 3-Clause "New" or "Revised" License
45 stars 26 forks source link

memaslap cannot be found after when do "configure --enable-memaslap" , compile and install #70

Closed m6w6 closed 4 years ago

m6w6 commented 4 years ago

Imported from Launchpad using lp2gh.


Hi, all,

I just downloaded the latest version "libmemcached-1.0.18" to try.

After "configure --enable-memaslap; make; make install", I cannot find the memaslap in the client folder and no errors ever appeared.

It takes me lot of time to search online the possible reason and solution.

The real reason you cannot get memaslap is the missing of libevent library. If you run "configure --enable-memaslap" and the following "checking test for a working libevent... no" appears, memaslap will not show up. However, the configure file does not give any hints when you configure with option --enable-memaslap.

1, [possible solution] in my centos 6.6, execute "yum install libevent libevent-devel". Then the following "checking test for a working libevent... yes" appears, memaslap will appear.

2, [modification to configure file] in order to let configure file to remind missing library when compile with memaslap, some modifications need to be added into configure file.

original configure file in libmemcached-1.0.18 from line 21667:


21667# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: 21668 if test "x$ax_cv_libevent" = xyes; then : 21669 21670 fi

modified into new configure file from line 21667:

21667 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: 21668 if test "x$ax_cv_libevent" = xyes; then : 21669 + # add by Tony 21670 + elif test "$ac_cv_enable_memaslap" = "yes"; then 21671 + as_fn_error $? "Unable to find libevent" "$LINENO" 5 21672 + # end by Tony 21673 fi

after this modification, when you execute "configure --enable-memaslap" without libevent, the following error reminder will appear in the terminal:


checking checking for cxx_gcc_abi_demangle... "yes" checking test for a working libevent... no configure: error: Unable to find libevent

if you do not have the option "--enable-memaslap", the configure file will be executed as usual.

then, what you need is just to install the corresponding missing library.

Hope this information is helpful for new tryers of memaslap. :-)

Tony S. Ph.D student of UCCS

m6w6 commented 4 years ago

it works...thx.very much...

m6w6 commented 4 years ago

in ubuntu:

sudo apt install libevent-dev -y

m6w6 commented 4 years ago

/bin/ld: clients/ms_thread.o: undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5' /bin/ld: note: 'pthread_key_delete@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line /lib64/libpthread.so.0: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make[1]: *** [clients/memaslap] Error 1


[solution] Try going into the Makefile and adding '-L/lib64 -lpthread' to the variable LDFLAGS.

m6w6 commented 4 years ago

diff -u Makefile-old Makefile --- Makefile-old 2018-12-29 21:42:23.813736760 +0000 +++ Makefile 2018-12-29 21:37:43.394410213 +0000 @@ -2934,7 +2934,7 @@ LCOV = LCOV_GENHTML = LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = +LDFLAGS = -L/lib64 -lpthread LEX = : LIBEVENT_LIB = -levent LIBGEARMAN_CPPFLAGS =

m6w6 commented 4 years ago

[error] memaslap: error while loading shared libraries: libmemcached.so.11: cannot open shared object file: No such file or directory

[solution] $ vim /etc/ld.so.conf

add /usr/local/lib at the bottom of the file, then $ ldconfig