Building MongoDB on Raspberry Pi

Iv’e been playing around with my Pi for a little while now, and one of the apps I’m trying to build for it requires MongoDB. Unfortunately, the Mongo source is very x86 specific, however whilst the newest version isn’t available on the ARM architecture, V1.8 is thanks to some patches from Per Ola Ingvarsson on Github at https://github.com/skrabban/mongo-nonx86.

 

So, to build MongoDB V1.8 on your RaspberryPi:

Install the dependent packages, including a minimal build system and LibBoost C++ libs:

sudo apt-get install git-core build-essential scons libpcre++-dev xulrunner-dev libboost-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev

 

Clone the Github repo:

git clone https://github.com/skrabban/mongo-nonx86

 

And compile and install it! (NB these two steps take a long time (many hours) on a raspberry Pi, I left mine going overnight for this.)

cd mongo-nonx86

scons

sudo scons --prefix=/opt/mongo install

 

This will install mongo in /opt/mongo, to get other programs to see it, you can add this dir to your $PATH:

PATH=$PATH:/opt/mongo/bin/

export PATH