The first step to a CouchDB server is the installation of the Erlang programming language. It’s available as source on

The required software should already be installed on your system. We will install Erlang to /opt/local like the other software required for CouchDB.


root@test:~# cd /tmp/
root@test:/tmp# wget
--2011-07-31 15:31:25--
Connecting to||: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


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:

            if (ioctl(desc->s, SIOCGIFHWADDR, (char *)&ifreq) < 0)
            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:

#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


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'


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().
2> q().
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

Related Posts

4 Kommentare bis “CouchDB on OpenSolaris: Part 1 – Erlang”

  1. [...] the installation of Erlang, the next dependency is [...]

  2. [...] the installation of the required software (Erlang, ICU and Spidermonkey) we can finally install CouchDB which is the easiest part of the whole [...]

  3. [...] CouchDB on OpenSolaris: Part 1 – Erlang CouchDB on OpenSolaris: Part 2 – ICU CouchDB on OpenSolaris: Part 3 – Spidermonkey CouchDB on OpenSolaris: Part 4 – CouchDB [...]

  4. [...] googling revealed this. Apparently you have to muck around a bit. Have you given it a [...]

Eine Antwort schreiben