I’m intending to play around with Redis a little over the next few days. I’ve been wanting to do this for a long time and I may have found a reason for me to do it now.
So I downloaded the source onto a VM and ran make where I was getting this error
zmalloc.o: In function `zmalloc_used_memory': /opt/redis-2.6.7/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4' collect2: ld returned 1 exit status make: *** [redis-server] Error 1 make: Leaving directory `/var/opt/redis-2.6.7/src' make: *** [all] Error 2
The solution is to explicitly declare the CPU type to make this work.
[[email protected] redis-2.6.7]# uname -m i686
I had earlier tried setting -march=i386 since that is the CPU type that yum uses. That didn’t work. So I set the CPU to exactly the output of uname -m.
[[email protected] redis-2.6.7]# export CFLAGS=-march=i686 [[email protected] redis-2.6.7]# make distclean [[email protected] redis-2.6.7]# make