For installing memcached in Mac OS you will need to install "libevent" library (libevent 1.1 or higher to deal with a kqueue bug)
Libevent is an 'event notification library' used my memcached.
Installing libevent & memcached
To manually download the latest stable version of this library visit the below link
http://libevent.org/
To download using curl from Mac OS X terminal use the following command
curl --remote-name --location https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gzIf terminal is connected to internet through proxy, you may not be able to download the file. To resolve this try "export https_proxy" command
Example: export https_proxy=http://proxy_ip:proxy_port
Unzip the tar.gz file downloaded using the following command
tar -xzvf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stableCompile and install the libevent library using the following command
./configure --prefix=/usr/local/libevent-2.0.22 --disable-dependency-tracking --disable-debug-mode
make
sudo make install
Create a symbolic link for "libevent" using the following command
ln -s libevent-2.0.22 /usr/local/libevent
After installing the dependency 'libevent' it's time to install the memcached
Download the stable memcached-1.4.21 version from memcached website.
http://memcached.org/files/memcached-1.4.21.tar.gzTo download from terminal use the following command
curl --remote-name http://www.memcached.org/files/memcached-1.4.22.tar.gz
Other stable versions of memcached can be downloaded from
http://www.memcached.org/files/
https://code.google.com/p/memcached/wiki/ReleaseNotes
Unzip memcached-1.4.21.tar.gz file using the following command
v commands to be verbose (display what's happening while executing)
Compile and install using the following commad
frequent errors:
Solution: Follow the above mentioned steps correctly.
Feel free to comment if you are facing any issues.
http://www.memcached.org/files/
https://code.google.com/p/memcached/wiki/ReleaseNotes
Unzip memcached-1.4.21.tar.gz file using the following command
tar -xzvf memcached-1.4.22.tar.gz
cd memcached-1.4.22x commands to exract
v commands to be verbose (display what's happening while executing)
Compile and install using the following commad
./configure --prefix=/usr/local/memcached-1.4.22 --with-libevent=/usr/local/libevent
makesudo make installIf necessary create symbolic link using the following command
ln -s memcached-1.4.22 /usr/local/memcached
frequent errors:
items.c:1141:28: error: comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
assert(it->slabs_clsid < LARGEST_ID);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
1 error generated.
make[2]: *** [memcached_debug-items.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Solution: Follow the above mentioned steps correctly.
Feel free to comment if you are facing any issues.
Got the same error and followed your instructions to a tee
ReplyDeleteI got the same error, you got some way to fix this problem?
ReplyDeleteHave you tried the steps mentioned and installed libevent ?
DeleteI'm getting the error when installing memcached 1.4.24. Installed 1.4.23 instead.
ReplyDelete