Compiling Node.js on Solaris - The Issues

Disclaimer: I’m not a sysadmin, better solutions are welcome.

Earlier today, I was trying to compile node.js on Solaris (x86, 64-bit), get it installed, and setup a simple OHAI server.

And as usual, installing stuffs on Solaris is never straightforward and I ended up encountering several issues. I’m sure these issues (specially the errors) will bite me again in the future, hence I’m blogging this.

First up…

nom> ./configure
/usr/bin/env: No such file or directory

Oh right, I forgot to install python and all of its dependencies. From node.js home page “The build system requires Python 2.4 or better.”

obj/release/mksnapshot obj/release/ --logfile "~/blah/ry-node-29ca7af/build/default/obj/release/snapshot.log" --log-snapshot-positions mksnapshot: fatal: open failed: No such file or directory
scons: *** [obj/release/] Error -9
scons: building terminated because of errors.
Waf: Leaving directory `~/blah/ry-node-29ca7af/build'
Build failed:  -> task failed (err #2):
        {task: libv8.a SConstruct -> libv8.a}
*** Error code 1

ldd is your friend every time you hit this kind of error. So I inspected mksnapshot…

nom> ldd obj/release/mksnapshot =>       /lib/ =>        /lib/ =>   /lib/ =>    /lib/ =>        (file not found) =>     /lib/ =>         (file not found) =>     /lib/ =>    /lib/ =>    /lib/ =>   /lib/ =>   /lib/ =>  /lib/ =>         /lib/ =>   /lib/

Turned out that both and were installed in /usr/local/lib but not available from /lib. So I simply created symlinks for /lib/ and pointing to /usr/local/lib . Another workaround was to set LD_LIBRARY_PATH=/usr/local/lib, but I heard it’s bad.

On to the next one…

ImportError: python: fatal: relocation error: file /usr/local/lib/python2.6/lib-dynload/ symbol inet_aton: referenced symbol not found

This one was just strange, I couldn’t figure out which library dependency was missing, and it took me a while to find out that the python binary I had wasn’t built correctly (some library links were missing from . At the end I used the binary from Sunfreeware which had the correct links.

I got this next error when I accidentally compiled node on a SPARC box, which I believe is not a supported architecture. c-ares only has sunos-x86 header files for Solaris.

../deps/c-ares/ares_expand_string.c:18:24: ares_setup.h: No such file or directory

And another one, on the same SPARC box…

TypeError: cannot concatenate 'str' and 'NoneType' objects:

This is a similar issue that stevel mentioned on nodejs Google Group. Basically deps/v8/SConstruct couldn’t figure out the compiler and returns ‘None’ which can’t be concatenated to a String, this line here…

the toolchain to use (' + TOOLCHAIN_GUESS + ')'

After 3-4 hours, I finally got node.js installed, and a simple server up and running on Solaris.

Share Comments
comments powered by Disqus