Skip to content
Brandon edited this page Sep 21, 2019 · 63 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:

  1. you need to have a machine with all the right packages installed
  2. you need to install some packages within a user's home directory
  3. you need to build RTBkit.

We tested this release on:

An Ubuntu 14.04 AMI (ami-c6d485ae) is available in US East(N. Virginia).

1) Machine-level Setup

Important note: if you are using Amazon instances for this, please do not use a Micro instance, as it will have insufficient RAM to compile. Amazon Small instances should be sufficient to build RTBKit. To run RTBKit or its tests, you'll need at least a xlarge instance.

Make sure you have at least 16GB of disk for building from the source. Also, your CPU should have support for SSE4.2 as it greatly improves performance.

  1. 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 linux-tools-generic libbz2-dev python-dev scons\
                       libtool liblzma-dev libblas-dev make automake \
                       ccache ant libcppunit-dev doxygen \
                       libcrypto++-dev libACE-dev gfortran liblapack-dev \
                       libevent-dev libssh2-1-dev libicu-dev libv8-dev \
                       g++ google-perftools libgoogle-perftools-dev \
                       zlib1g-dev git pkg-config valgrind autoconf \
                       libcurl4-openssl-dev cmake libsigc++-2.0-dev
  1. Please also have JDK8 installed.

2) 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/"

Then run this command to apply changes:

$ source ~/.profile

To see if your environment is properly setup run:

$ env | grep PATH

Make sure you get an output similar to this:

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/

RTBkit-deps

You should now be ready to install the rtbkit-deps:

$ git clone https://github.com/rtbkit/rtbkit-deps.git
$ cd rtbkit-deps
$ git submodule update --init

Ubuntu 12 You may choose if you want nodejs enabled NODEJS_ENABLED=1 or disabled NODEJS_ENABLED=0.

Ubuntu 14 You will have to disable nodejs NODEJS_ENABLED=0.

$ make all NODEJS_ENABLED=0

To speed up compilation times you should not use the -jX argument on make, but instead give it JOBS=X.

You would also need to add your SSH key to your github account to use git submodule update. Please see github instruction

3) Building RTBkit

Now you're ready to build RTBkit.

$ sudo su - rtbkit
$ git clone https://github.com/rtbkit/rtbkit.git
$ cd rtbkit
$ cp jml-build/sample.local.mk local.mk

Again here you will have to use the NODEJS_ENABLED flag depending on which OS you're building.

Ubuntu 12 you may choose either NODEJS_ENABLED=1 or NODEJS_ENABLED=0

$ make dependencies NODEJS_ENABLED=1
$ make compile NODEJS_ENABLED=1
$ make test

Ubuntu 14 you will have to use NODEJS_ENABLED=0

$ make compile NODEJS_ENABLED=0
$ make test NODEJS_ENABLED=0

For the test suite to pass it is currently required that you do not have a bootstrap.json in your project root and that you do not try to run make test in parallel mode (-jX option).

Note that make should be invoked from the root directory of RTBKit.

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 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