Building on Solaris/SPARC

104 views
Skip to first unread message

Max Afonov

unread,
Dec 18, 2009, 9:12:10 PM12/18/09
to mongodb-user
Hello, all.

I've been working on producing a 64-bit build of MongoDB for our
Solaris boxes. I've built 64-bit versions of SpiderMonkey (with
support for threads & UTF-8), NSPR, pcrecpp, readline, and Boost (just
the libs listed in MongoDB's SConstruct).

Everything seemingly builds well, however, when I attempt to run
either of the Mongo programs (mongo or mongod) I get a "Bus Error
(core dumped)". I don't have access to the core at this hour (they're
400 root per company policy), although I will be able to get it on
Monday. For reference, the git rev I built is 159f7df.

Meanwhile, I'm wondering whether anyone out there has succeeded in
making a 64-bit build of MongoDB for Solaris on SPARC. I have googled
for packages, to no avail. Even so, I'm pretty sure our SAs are going
to have to want to build this by hand before a MongoDB instance goes
into production.

Any and all insight is appreciated.

Thanks,
-max

Eliot Horowitz

unread,
Dec 18, 2009, 9:29:49 PM12/18/09
to mongod...@googlegroups.com
mongo requires little endian processors.
many modern compilers support switching endianness.
what compiler are you using? may just need to add a flag, or it may be daunting

> --
>
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>
>

Max Afonov

unread,
Dec 18, 2009, 10:26:29 PM12/18/09
to mongodb-user
Nothing exotic here, just a 32-bit GCC 4.3.4 on a sun4u machine. GCC
does have -mlittle-endian which I'll add to my CXXFLAGS. We'll see how
that goes.

Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: ./configure --prefix=/opt/mlb --with-cc=/opt/mlb/bin/
gcc --with-as=/opt/mlb/bin/as --with-ld=/opt/mlb/bin/ld --enable-
shared --enable-languages=c,c++ --with-gmp=/opt/mlb --with-mpfr=/opt/
mlb
Thread model: posix
gcc version 4.3.4 (GCC)

Max Afonov

unread,
Dec 18, 2009, 11:15:01 PM12/18/09
to mongodb-user
As it turns out, from experience (and the GCC manual[1]), -mlittle-
endian isn't supported on Solaris and Linux. This begs the question:
has Mongo ever been tested on a big-endian CPU?

[1]: http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/SPARC-Options.html#SPARC-Options

Eliot Horowitz

unread,
Dec 18, 2009, 11:18:37 PM12/18/09
to mongod...@googlegroups.com
It won't work big endian. There are a lot of assumptions about things
being little endian.
Would be a fair amount of work to make it work.
Some of the drivers work, notable the c driver.

Max Afonov

unread,
Dec 18, 2009, 11:39:21 PM12/18/09
to mongodb-user
Do you have any practical suggestions regarding how a SPARC-centric
organization might go about running MongoDB? As far as I know, we
don't have a single non-SPARC machine in our data center. Not one that
I've seen anyway. Latency to EC2 would most likely kill us.

What I'm driving towards is this: we can't be the only shop running on
Sun hardware, and we can't be the only company that wants to use
MongoDB in production. These two sets are bound to intersect at some
point.

On Dec 18, 11:18 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> It won't work big endian.  There are a lot of assumptions about things
> being little endian.
> Would be a fair amount of work to make it work.
> Some of the drivers work, notable the c driver.
>
>
>
> On Fri, Dec 18, 2009 at 11:15 PM, Max Afonov <m...@bumnetworks.com> wrote:
> > As it turns out, from experience (and the GCC manual[1]), -mlittle-
> > endian isn't supported on Solaris and Linux. This begs the question:
> > has Mongo ever been tested on a big-endian CPU?
>

> >  [1]:http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/SPARC-Options.html#SPARC-...

Eliot Horowitz

unread,
Dec 19, 2009, 9:46:34 AM12/19/09
to mongod...@googlegroups.com
Unfortunately I think the only solution is making the code work on big
endian processers if the compiler can't help.

There hasn't been much demand for this, so hasn't been on the top of our list...

Dwight Merriman

unread,
Dec 19, 2009, 9:52:28 AM12/19/09
to mongod...@googlegroups.com
it would be great to have this support perhaps someone out in the community would like to work on it?
Reply all
Reply to author
Forward
0 new messages