Skip to content
EricRobert edited this page Apr 15, 2013 · 52 revisions

This guide will show you how to set up a machine and user environment to build RTBkit and run a demo program.

There are three levels of setup: you need need to have a machine with all the right packages installed, you need to install some packages within a user's home directory, and then you need to build RTBkit.

The first two steps can be skipped by launching an Amazon instance based on ami-340f9f5d available in the US East (N. Virginia) region: the right packages are installed and the user-level setup has already been done for the rtbkit user.

Machine-level Setup

RTBkit was developed and is tested to run on Ubuntu 12.04.2 LTS (Precise Pangolin) 64-bit. Note that a 64-bit system is currently required because of the 4GB memory limit of 32-bit systems.

You should run the following command to ensure you have all of the required dependencies which can be installed via apt:

$ sudo apt-get install git-core g++ libbz2-dev \
liblzma-dev libcrypto++-dev libpqxx3-dev scons libicu-dev \
strace emacs ccache make gdb time automake libtool autoconf \
bash-completion google-perftools libgoogle-perftools-dev \
valgrind libACE-dev gfortran linux-tools uuid-dev liblapack-dev \
libblas-dev libevent-dev flex bison pkg-config python-dev \
python-numpy python-numpy-dev python-matplotlib libcppunit-dev \
python-setuptools ant openjdk-7-jdk libcppunit-dev doxygen \
libfreetype6-dev libpng-dev python-tk tk-dev python-virtualenv \
liblzma-dev sshfs rake ipmitool mm-common

User-level Setup

Environment Variables

Add the following to your ~/.profile and/or whatever your shell requires for the equivalent effect:

# Add local directory for libraries, etc
mkdir -p $HOME/local/bin
PATH="$HOME/local/bin:$PATH"
 
mkdir -p $HOME/local/lib
export LD_LIBRARY_PATH="$HOME/local/lib:$LD_LIBRARY_PATH"
 
export PKG_CONFIG_PATH="$HOME/local/lib/pkgconfig/:$HOME/local/lib/pkg-config/"

To see if your environment is properly setup, make sure you get an output similar to this:

$ env | grep PATH
LD_LIBRARY_PATH=/home/rtbkit/local/lib:
PATH=/home/rtbkit/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PKG_CONFIG_PATH=/home/rtbkit/local/lib/pkgconfig/:/home/rtbkit/local/lib/pkg-config/

platform-deps

You'll need to install a bunch of dependencies which are wrapped up in the Datacratic platform-deps repo:

$ git clone https://github.com/datacratic/platform-deps.git
$ cd platform-deps
$ git submodule update --init
$ make -k all

If you have trouble compiling these dependencies, you may find some help in the platform-deps README. One known issue is that it takes a fair bit of memory to compile these dependencies depending on how much parallelization you use with make.

Building RTBkit

Now you're ready to build RTBkit proper.

$ git clone https://github.com/rtbkit/rtbkit-preview.git
$ cd rtbkit-preview
$ git submodule update --init
$ make nodejs_dependencies
$ make compile
$ make test

Now what?

The best entry-points into the RTBkit source are in the /examples directory, especially the rtbkit_integration_test, which can be run with make run_rtbkit_integration_test

Also, some of those example components are used by the Demo Stack that provides a simple runnable RTB stack using a synthetic exchange.

Clone this wiki locally