Redis [Snippet] Redis 32bit compiling problem on ubuntu 13.04

Redis logo

root@ubuntu-1303-amd64:/home/adminuser/redis-2.6.7# make 32bit
cd src && make 32bit
make[1]: Entering directory `/home/adminuser/redis-2.6.7/src’

WARNING: if it fails under Linux you probably need to install libc6-dev-i386

make CFLAGS=”-m32″ LDFLAGS=”-m32″
make[2]: Entering directory `/home/adminuser/redis-2.6.7/src’
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[3]: Entering directory `/home/adminuser/redis-2.6.7/deps’
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[3]: Leaving directory `/home/adminuser/redis-2.6.7/deps’
(rm -f .make-*)
echo STD=-std=c99 -pedantic >> .make-settings
echo WARN=-Wall >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS=-m32 >> .make-settings
echo LDFLAGS=-m32 >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -Wall -O2 -g -rdynamic -ggdb -m32 -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS=-m32 -g -rdynamic -ggdb >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[3]: Entering directory `/home/adminuser/redis-2.6.7/deps’
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo “-m32” > .make-ldflags)
(echo “-m32” > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[4]: Entering directory `/home/adminuser/redis-2.6.7/deps/hiredis’
cc -std=c99 -pedantic -c -O3 -fPIC -m32 -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
net.c:34:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
make[4]: *** [net.o] Error 1
make[4]: Leaving directory `/home/adminuser/redis-2.6.7/deps/hiredis’
make[3]: *** [hiredis] Error 2
make[3]: Leaving directory `/home/adminuser/redis-2.6.7/deps’
make[2]: [persist-settings] Error 2 (ignored)
CC adlist.o
In file included from /usr/include/features.h:341:0,
from /usr/include/stdlib.h:24,
from adlist.c:32:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
make[2]: *** [adlist.o] Error 1
make[2]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make[1]: *** [32bit] Error 2
make[1]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make: *** [32bit] Error 2
root@ubuntu-1303-amd64:/home/adminuser/redis-2.6.7# make
cd src && make all
make[1]: Entering directory `/home/adminuser/redis-2.6.7/src’
CC adlist.o
In file included from /usr/include/features.h:341:0,
from /usr/include/stdlib.h:24,
from adlist.c:32:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make: *** [all] Error 2

If got error like me, just type this command, apt-get install libc6-dev-i386 . And now redis ready to use.

Advertisements

2 thoughts on “Redis [Snippet] Redis 32bit compiling problem on ubuntu 13.04

  1. Thanks for this post! I was just trying to compile something for 32 bit and got “/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory” in response. Googling that line brought this page up as the first result, and sure enough, installing libc-dev-i386 solved everything. Even though my issue was not redis – oriented, thanks for the post!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s