Getting MongoDB running on Solaris 10

Posted by – July 20, 2009

That’s what I did to get MongoDB running on Solaris 10:

1. Download, compile and install gcc 4.4

MongoDB can’t be compiled with bundled version of gcc on Solaris 10, it requires gcc 4.0 at least, I couldn’t find the binary package of gcc 4 for Solaris 10 anywhere on the web, so I decided to download and compile gcc 4 by myself.

You may get some build errors because of missing targets during build process, try run “make -i” to ignore build errors.

2. Download, compile and install SpiderMonkey 1.8.0 RC 1

Another MongoDB dependency is SpiderMonkey, MongoDB uses SpiderMonkey to process JSON data, please download and uncompress SpiderMonkey sources.

Once the tarball is successfully downloaded, you must make a copy of makefile for Solaris 10 for Inter PCs by running the following command:

cp config/ config/

And set the PATH with the directory that contains the ar tool:

export PATH=$PATH:/usr/ccs/bin

Now run the following command fron src directory:

gmake -f Makefile.ref

3. Download, compile and install Boost 1.39.0

Boost is also required to compile MongoDB, you must download and uncompress the source tarball.

4. Download, compile and install scons 1.2.0

Scons is the software construction tool used to build MongoDB, it runs on top of pyton, I’m pretty sure about python version bundled with Solaris 10 is enougth to run scons. You can download scons here.

5. Download, compile and install MongoDB 0.9.6

The source tarbal of MongoDB can be downloaded here, once downloaded you must uncompress the source tarball and do following changes on files below:


At line 358 please insert:

env.Append( CPPPATH=[ "/usr/local/include/boost-1_39" ])

At line 643 please insert:

  if solaris:
        myCheckLib ( "rt", False)
        env.Append ( LIBS=[ "rt" ])
        myCheckLib ( "nsl", False)
        env.Append ( LIBS=[ "nsl" ])


Please change the line 26 to:

#if !defined(_WIN32) and !defined(__sunos__)


Please change the line 50 to:

#if !defined(_WIN32) and !defined(__sunos__)


Please change the line 75 to:

#if !defined(_WIN32) and !defined(__sunos__)

Now run the following command:

scons . --release --boost-compiler=gcc44

After execute all steps above you are ready to start MondoDB by running mongod on terminal window.


2 Comments on Getting MongoDB running on Solaris 10

  1. Luis Alberto Silva Chavez says:

    Hi Rogeiro

    Do you know if this works with SPARC CPU ?

    Thanks in advance

    Luis Silva

  2. rogerio says:

    Yes, why not? I believe it’s just a matter of GCC avaliability for this processor architecture.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>