The first step to a CouchDB server is the installation of the Erlang programming language. It’s available as source on http://www.erlang.org/download.html.
The required software should already be installed on your system. We will install Erlang to /opt/local like the other software required for CouchDB.
Basics
root@test:~# cd /tmp/ root@test:/tmp# wget http://www.erlang.org/download/otp_src_R14B03.tar.gz --2011-07-31 15:31:25-- http://www.erlang.org/download/otp_src_R14B03.tar.gz Connecting to www.erlang.org|192.121.151.107|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 70620709 (67M) 1 Saving to: `otp_src_R14B03.tar.gz' 100%[========================================================>] 70,620,709 709K/s in 98s 2011-07-31 15:33:03 (702 KB/s) - `otp_src_R14B03.tar.gz' saved [70620709/70620709] root@test:/tmp# tar xvf otp_src_R14B03.tar.gz Decompressing 'otp_src_R14B03.tar.gz' with '/usr/bin/gzcat'... x otp_src_R14B03, 0 bytes, 0 tape blocks x otp_src_R14B03/.mailmap, 128 bytes, 1 tape blocks ... root@test:/tmp# cd otp_src_R14B03
Preparations
Erlang will not compile unless we remove some lines from ./erts/emulator/drivers/common/inet_drv.c. In this file you can find the following lines:
#ifdef SIOCGIFHWADDR
if (ioctl(desc->s, SIOCGIFHWADDR, (char *)&ifreq) < 0)
break;
buf_check(sptr, s_end, 1+2+IFHWADDRLEN);
*sptr++ = INET_IFOPT_HWADDR;
put_int16(IFHWADDRLEN, sptr); sptr += 2;
/* raw memcpy (fix include autoconf later) */
sys_memcpy(sptr, (char*)(&ifreq.ifr_hwaddr.sa_data), IFHWADDRLEN);
sptr += IFHWADDRLEN;
#elif defined(SIOCGENADDR)
Those have to be changed to:
#ifdef SIOCGIFHWADDR #elif defined(SIOCGENADDR)
Another issue is a missing +x for the install script which prevents the execution of gmake install.
root@test:/tmp/otp_src_R14B03# chmod +x lib/erl_interface/src/auxdir/install-sh
Finally we have to ensure that gmake uses the Solaris linker (LD) and GCC 4.3
root@test:/tmp/otp_src_R14B03# PATH=/usr/bin:/usr/gcc/4.3/bin:$PATH
Building
After those preparations, the build process is straight forward.
root@test:/tmp/otp_src_R14B03# ./configure --prefix=/opt/local Ignoring the --cache-file argument since it can cause the system to be erroneously configured Disabling caching checking build system type... i386-pc-solaris2.11 checking host system type... i386-pc-solaris2.11 ... root@test:/tmp/otp_src_R14B03# gmake test X"$ERTS_SKIP_DEPEND" = X"true" || (cd erts/emulator && ERL_TOP=/tmp/otp_src_R14B03 make generate depend) make[1]: Entering directory `/tmp/otp_src_R14B03/erts/emulator' make -f i386-pc-solaris2.11/Makefile generate ... drink a coffee or two... root@test:/tmp/otp_src_R14B03# gmake install cd erts && ERL_TOP=/tmp/otp_src_R14B03 make NO_START_SCRIPTS=true FLAVOR= make[1]: Entering directory `/tmp/otp_src_R14B03/erts' make[2]: Entering directory `/tmp/otp_src_R14B03/erts/emulator' ...
Test
Now we can test if Erlang is installed and works (including OpenSSL).
root@test:/tmp/otp_src_R14B03# cd /opt/local/bin/ root@test:/opt/local/bin# ./erl Erlang R14B03 (erts-5.8.4) 1 [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.8.4 (abort with ^G) 1> crypto:start(). ok 2> q(). ok 3> root@test:/opt/local/bin#
Next steps
After installing Erlang we can proceed to Part 2 of this guide:
CouchDB on OpenSolaris: Part 2 – ICU

[...] the installation of Erlang, the next dependency is [...]
[...] the installation of the required software (Erlang, ICU and Spidermonkey) we can finally install CouchDB which is the easiest part of the whole [...]
[...] CouchDB on OpenSolaris: Part 1 – Erlang CouchDB on OpenSolaris: Part 2 – ICU CouchDB on OpenSolaris: Part 3 – Spidermonkey CouchDB on OpenSolaris: Part 4 – CouchDB [...]
[...] googling revealed this. Apparently you have to muck around a bit. Have you given it a [...]