Compiling Redis 2.6.4 on a 32-bit system?

394 views
Skip to first unread message

Dennis McEntire

unread,
Nov 14, 2012, 8:29:25 PM11/14/12
to redi...@googlegroups.com
I am not sure if this is a resolved issue, but I am trying to compile Redis 2.6.4 on a 32-bit platform. Here's the steps I have taken so far:

1. make 32bit doesn't work, it errors out with this error:

zmalloc.o: In function `zmalloc_used_memory':
/redis-2.6.4/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
make[2]: *** [redis-server] Error 1

2. I tried adding a line to the src/Makefile here and it didn't help (last line listed here):

# Default settings
STD= -std=c99 -pedantic
WARN= -Wall
OPT= $(OPTIMIZATION)
CFLAGS= -march=i686

3. Since I am using Mandriva (RH based) I then installed glibc-devel and that didn't help (same error).

I'm at a bit of a loss here; maybe it's no longer compatible with 32-bit systems? I installed 2.4.9 on the same system just before trying 2.6.4 and it worked fine.

Thanks in advance for any help,

Dennis



Dennis McEntire

unread,
Nov 14, 2012, 8:34:21 PM11/14/12
to redi...@googlegroups.com

Also, not sure if this is important, here's what I have on this system:

[root@redis1 ~]# gcc -v
Using built-in specs.
Target: i586-manbo-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-checking=release --enable-languages=c,c++,fortran,objc,obj-c++,java --build=i586-manbo-linux-gnu --host=i586-manbo-linux-gnu --with-cpu=generic --with-system-zlib --enable-threads=posix --enable-shared --enable-long-long --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-gtk-cairo --disable-libjava-multilib --enable-ssp --disable-libssp --disable-werror
Thread model: posix
gcc version 4.3.2 (GCC)

[root@redis1 ~]# uname -a
Linux redis1 2.6.29.6-server-3mnb #1 SMP Fri Dec 4 16:07:08 EST 2009 i686 Intel(R) Xeon(TM) CPU 3.20GHz GNU/Linux

[root@redis1 ~]# cat /etc/redhat-release
Mandriva Linux release 2009.1 (Official) for i586

CharSyam

unread,
Nov 14, 2012, 8:55:28 PM11/14/12
to redi...@googlegroups.com
try using -march=native or -march=i586 option, Even though you already use try -march=i686 
maybe your system use i586 system architecture. wish you luck.


2012/11/14 Dennis McEntire <dmce...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/BGcRdO2Wp6wJ.

To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.

Dennis McEntire

unread,
Nov 14, 2012, 9:16:31 PM11/14/12
to redi...@googlegroups.com

Thank you, I tried these and none of them helped:

CFLAGS= -march=pentium
CFLAGS= -march=native
CFLAGS= -march=i486
CFLAGS= -march=i586
CFLAGS= -march=i686

Maybe I am not putting the line in the right place? I am editing src/Makefile and adding it towards the beginning of the file, here:


# Default settings
STD= -std=c99 -pedantic
WARN= -Wall
OPT= $(OPTIMIZATION)
CFLAGS= -march=i486

Dennis

Dennis McEntire

unread,
Nov 14, 2012, 9:27:37 PM11/14/12
to redi...@googlegroups.com


After some more looking around, I figured it out. Here's what I did in case it helps someone else:

Edit src/.make-setttings

Modify this line to be like this:

REDIS_CFLAGS=-march=i586

Then it complied and installed properly after that (after using 'make 32bit').

Dennis

CharSyam

unread,
Nov 14, 2012, 9:31:26 PM11/14/12
to redi...@googlegroups.com
Excuse me how to build it.
just using type "make" or "make 32bit" 

how about this
edit Makefile 
32bit: header
at that time you can see below lines
32bit:
    @echo ""
    @echo "WARNING: if it fails under Linux you probably need to install libc6-dev-i386"
    @echo ""
    $(MAKE) CFLAGS="-m32" LDFLAGS="-m32"

and change it to CFLAGS="-m32 -march=native"

32bit:
    @echo ""
    @echo "WARNING: if it fails under Linux you probably need to install libc6-dev-i386"
    @echo ""
    $(MAKE) CFLAGS="-m32 -march=native" LDFLAGS="-m32"




2012/11/14 Dennis McEntire <dmce...@gmail.com>
To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/dPoUOEDjwDAJ.

CharSyam

unread,
Nov 14, 2012, 9:32:38 PM11/14/12
to redi...@googlegroups.com
it is because of "make 32bit"

CFLAGS="-m32" maybe overwrite your CFLAGS setting ^^

 


2012/11/14 CharSyam <char...@gmail.com>
Reply all
Reply to author
Forward
0 new messages