Thursday, June 3, 2010

Game Night Report #1

Attendees:
Bridgit, Cale, Danny

Played:
Puerto Rico (Victor: Danny)

Sunday, May 2, 2010

Building and Running couchdb 0.11.0 on Lucid Lynx

I took the plunge yesterday and upgraded to Ubuntu Lucid Lynx. Everything went as expected, until I tried to install the latest version of CouchDB.

One of couch's dependencies is Mozilla Spidermonkey. In the INSTALL.Unix file, the suggestion is to use
sudo apt-get install libmozjs-dev
to install Spidermonkey. Sadly, Ubuntu has removed libmozjs-dev from Lucid, so off I went to find a workaround.

The workaround that I eventually stumbled on (after trying to build Spidermonkey from source fro both the 1.8.0rc1 package, and the tip of the Mercurial repo), was to install the xulrunner-dev package (which, as of this writing is version 1.9.2.3). Once I had that, I was able to build couchdb as follows

$ cd apache-couchdb
$ ./configure --with-js-include=/usr/lib/xulrunner-devel-1.9.2.3/include/ --with-js-lib=/usr/lib/xulrunner-devel-1.9.2.3/lib/
$ make
$ sudo make install

However, my troubles weren't quite over yet. When I ran couch from the command line, and tried to run the test suite in futon, I saw this error:

[error] [<0.164.0>] OS Process Error <0.452.0> :: {os_process_error,{exit_status,127}}
/usr/local/lib/couchdb/bin/couchjs: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory

Running ldd on /usr/local/lib/couchdb/bin/couchjs indicated that, indeed, couchjs couldn't locate libmozjs.so. After some poking around, I settled on this as best course of action:

$ echo /usr/lib/xulrunner-devel-1.9.2.3/lib > /tmp/couchdb.conf
$ sudo mv /tmp/couchdb.conf /etc/ld.so.conf.d
$ sudo ldconfig

That run, ldd /usr/local/lib/couchdb/bin/couchjs showed that I was in the clear (that couchjs could finally locate libmozjs.so), and running the test suite confirmed it.