Thursday, January 12, 2012

Couchbase Server meets SmartOS!

I've loved Solaris since we first met back in 95. Since then I've been using Solaris as my primary os (including desktop). For a period of time I even ran Trusted Solaris 2.5 on my SS5 ;-) The kernel and all of the fantastic tools available makes it a superior platform for software development.

Ever since I started working for NorthScale (now Couchbase) I've done my very best to ensure that our stuff works on Solaris (if not I'd have a hard time doing any development ;), so getting it to work on SmartOS shouldn't be a big problem.

So far I've only been using the Sun Studio tools (I can't help it but I still find dbx superior to gdb...), but a few days ago I added a slave running SmartOS to my Jenkins cluster to see how much work it would be to get everything built with the tools and libraries I could install with pkgin. We do compile our software on different platforms and with different compilers, so I didn't expect too much trouble.

The "biggest" problem I had was to get libtool to stop trying to link 32bit object files into my 64 bit binaries. The workaround so far is to use:
CXX="g++ -m64 -L/opt/local/lib/amd64"
CC="gcc -m64 -L/opt/local/lib/amd64"

This was a small goal for me, but it will really ease my testing of a full cluster :-)

Now that I've got everything built on SmartOS, OpenIndiana, Soalris 10 I guess I should create packages for pkgin, IPS and SVr4 :)

7 comments:

  1. Hi,

    Hi Trond,

    I am trying to compile Couchbase 2.0.1 on SmartOS (Image: base64 1.9.1) and am getting the following error on 'make':

    checking for snappy-c.h... no
    checking for netinet/in.h... yes
    checking for inttypes.h... (cached) yes
    checking for libsnappy... no
    configure: error: Failed to locate snappy-c.h
    make: *** [couchstore/Makefile] Error 1

    I have installed the snappy-1.0.5 package which includes /opt/local/include/snappy-c.h
    Any idea how to overcome this? Do you have any other pointers that I'll need for completing the build?
    You mentioned above that you needed to use the "CXX=" and "CC=" workarounds, where did you place those values?

    Thanks!
    Chaim

    ReplyDelete
  2. I was able to bypass the snappy problem by using the "make" command line below:

    make CXX="g++ -m64 -L/opt/local/lib --prefix=/opt/local" CC="gcc -m64 -std=gnu99 -L/opt/local/lib --prefix=/opt/local" LD_LIBRARY_PATH=/opt/local/lib:/usr/lib:/lib

    Now I'm stuck on moxi not finding the header files that are in 'install/include/libvbucket/'. I'll report back if I resolve this.
    Any pointers would be welcome.

    ReplyDelete
    Replies
    1. Hi, Sorry for the late answer, but I've been on vacation for a couple of weeks :-) I'll try to see if I still have the vm where I built it on (if not I'll try to rebuild a setup next week(ish)

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Thanks!!

      For completeness here are some more details:

      These are the dependencies that I installed:
      pkgin -y in snappy erlang automake autoconf libevent

      This is the make command line that I am using:
      make CXX="g++ -m64 -L/opt/local/lib --prefix=/opt/local" CC="gcc -m64 -std=gnu99 -L/opt/local/lib --prefix=/opt/local" LD_LIBRARY_PATH=/opt/local/lib:/usr/lib:/lib

      This is the error that I am getting during the compilation of moxi:
      CC moxi-solaris_priv.o
      In file included from memcached.h:588:0,
      from solaris_priv.c:5:
      util.h:69:10: warning: redundant redeclaration of 'ntohll' [-Wredundant-decls]
      In file included from /usr/include/netinet/in.h:72:0,
      from /usr/include/sys/socket.h:49,
      from config_static.h:46,
      from config.h:403,
      from solaris_priv.c:1:
      /usr/include/sys/byteorder.h:97:17: note: previous declaration of 'ntohll' was here
      In file included from memcached.h:588:0,
      from solaris_priv.c:5:
      util.h:70:10: warning: redundant redeclaration of 'htonll' [-Wredundant-decls]
      In file included from /usr/include/netinet/in.h:72:0,
      from /usr/include/sys/socket.h:49,
      from config_static.h:46,
      from config.h:403,
      from solaris_priv.c:1:
      /usr/include/sys/byteorder.h:96:17: note: previous declaration of 'htonll' was here
      CCLD moxi
      Undefined first referenced
      symbol in file
      vbucket_get_vbucket_by_key moxi-mcs.o
      vbucket_compare moxi-mcs.o
      vbucket_found_incorrect_master moxi-mcs.o
      vbucket_config_parse_string moxi-mcs.o
      vbucket_config_get_num_servers moxi-mcs.o
      vbucket_config_get_password moxi-mcs.o
      vbucket_get_error moxi-agent_config.o
      vbucket_config_get_user moxi-mcs.o
      vbucket_free_diff moxi-mcs.o
      vbucket_config_destroy moxi-mcs.o
      vbucket_get_master moxi-mcs.o
      vbucket_config_get_server moxi-mcs.o
      ld: fatal: symbol referencing errors. No output written to moxi
      collect2: error: ld returned 1 exit status
      make[3]: *** [moxi] Error 1
      make[3]: Leaving directory `/root/couchbase-server_src/moxi'
      make[2]: *** [install-recursive] Error 1
      make[2]: Leaving directory `/root/couchbase-server_src/moxi'
      make[1]: *** [install] Error 2
      make[1]: Leaving directory `/root/couchbase-server_src/moxi'
      make: *** [make-install-moxi] Error 2

      Delete
    4. Hi, I wrote a new blog post about the topic this morning. See http://goo.gl/DHjN9Q

      Delete