Product tutorials, how-tos, and fully-documented APIs.

Installing Erlang

    Riak 1.2, 1.2.1, 1.3 and 1.3.1 require Erlang R15B01.

    Riak 1.0 requires Erlang R14B03 or later. Riak versions prior to 1.0 will not function on the R14B02 or later.

    Riak versions prior to 0.12 will not function on the R14 series of Erlang. For Erlang to build and install, you must have a GNU-compatible build system, and the development bindings of ncurses and openssl.

    Erlang Version Note

    The Riak binary packages for Debian and Ubuntu, Mac OS X, and RHEL and CentOS include an Erlang distribution, and do not require that you build Erlang from source. However, you must download and install Erlang if you are planning on completing The Riak Fast Track.

    Install using kerl

    You can install different Erlang versions in a simple manner with the kerl script. This is probably the easiest way to install Erlang from source on a system, and typically only requires a few commands to do so. Install kerl by running the following command:

    curl -O https://raw.github.com/spawngrid/kerl/master/kerl; chmod a+x kerl
    

    To compile Erlang as 64-bit on Mac OS X, you need to instruct kerl to pass the correct flags to the configure command. The easiest way to do this is by creating a ~/.kerlrc file with the following contents:

    KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads
                            --enable-kernel-poll  --enable-darwin-64bit"
    

    Note that when building Erlang on a FreeBSD/Solaris system (including SmartOS), HIPE should be disabled on these platforms as well with the above --disable-hipe option.

    Building with kerl on GNU/Linux has the same prerequisites that building from source does.

    Building the Erlang release of your choice is one command; as of Riak version 1.2, you should build and use Erlang version R15B01 like this:

    ./kerl build R15B01 r15b01
    

    This builds the Erlang distribution, and does all the steps required to manually install Erlang for you.

    When successfully built you can install the build using:

    ./kerl install r15b01 ~/erlang/r15b01
    . ~/erlang/r15b01/activate
    

    The last line activates the Erlang build that was just installed into ~/erlang/r15b01. See the kerl readme for more details on the available commands.

    If you prefer to install Erlang manually from the source code, the following will show you how.

    Installing on GNU/Linux

    Most GNU/Linux distributions do not make the most recent Erlang release available, so you will need to install from source.

    First, make sure you have a compatible build system and have installed the necessary dependencies.

    Debian/Ubuntu Dependencies

    Use this command to install the required dependency packages:

    sudo apt-get install build-essential libncurses5-dev openssl libssl-dev fop xsltproc unixodbc-dev
    

    If you'll be using a graphical environment (such as for development purposes) and would like to use Erlang's GUI utilities, then you'll need to install some additional dependencies.

    Note that these packages are not required for operation of a Riak node and notes in the build output about missing support for wxWidgets can be safely ignored when installing Riak in a typical non-graphical server environment.

    To install packages for graphics support, use this command:

    sudo apt-get install libwxbase2.8 libwxgtk2.8-dev libqt4-opengl-dev 
    

    RHEL/CentOS Dependencies

    Use this command to install the required dependency packages:

    sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
    

    Erlang

    Next, download, build and install Erlang:

    wget http://erlang.org/download/otp_src_R15B01.tar.gz
    tar zxvf otp_src_R15B01.tar.gz
    cd otp_src_R15B01
    ./configure && make && sudo make install
    

    Installing on Mac OS X

    You can install Erlang in several ways on OS X: from source, with Homebrew, or with MacPorts.

    Source

    To build from source, you must have Xcode tools installed from the CD that came with your Mac or from the Apple Developer website.

    First, download and unpack the source:

    curl -O http://erlang.org/download/otp_src_R15B01.tar.gz
    tar zxvf otp_src_R15B01.tar.gz
    cd otp_src_R15B01
    

    Next, configure Erlang.

    Mountain Lion (OS X 10.8) and Lion (OS X 10.7) If you're on Mountain Lion (OS X 10.8) or Lion (OS X 10.7) you can use LLVM (the default) or GCC to compile Erlang.

    Using LLVM:

    CFLAGS=-O0 ./configure --disable-hipe --enable-smp-support --enable-threads \
    --enable-kernel-poll --enable-darwin-64bit
    

    If you prefer GCC:

    CC=gcc-4.2 CPPFLAGS='-DNDEBUG' MAKEFLAGS='-j 3' \
    ./configure --disable-hipe --enable-smp-support --enable-threads \
    --enable-kernel-poll --enable-darwin-64bit
    

    Snow Leopard (OS X 10.6) If you're on Snow Leopard (OS X 10.6) or Leopard (OS X 10.5) with an Intel processor:

    ./configure --disable-hipe --enable-smp-support --enable-threads \
    --enable-kernel-poll  --enable-darwin-64bit
    

    If you're on a non-Intel processor or older version of OS X:

    ./configure --disable-hipe --enable-smp-support --enable-threads \
    --enable-kernel-poll
    

    Now build and install:

    make && sudo make install
    

    You will be prompted for your sudo password.

    Homebrew

    If you want to install Riak with Homebrew, follow the Mac OS X Installation documentation, and Erlang will be installed automatically.

    To install Erlang separately with Homebrew, use this command:

    brew install erlang
    

    MacPorts

    Installing with MacPorts is easy:

    port install erlang +ssl