blob: bc35e1670ce3c31d6b69edc3ed5de1e2cc696d4d [file] [log] [blame]
yoshi94c2e562014-01-22 15:18:57 -08001#!/bin/sh
2
Yuta HIGUCHI4d70a012014-03-26 17:56:40 -07003# fail on command error
4set -e
5# echo back each command
yoshi94c2e562014-01-22 15:18:57 -08006set -x
7
Yuta HIGUCHI318d9d12014-04-10 17:00:32 -07008export ONOS_HOME=${ONOS_HOME:-$(cd `dirname $0`; pwd)}
9export RAMCLOUD_HOME=${RAMCLOUD_HOME:-~/ramcloud}
yoshi94c2e562014-01-22 15:18:57 -080010
Yuta HIGUCHI30e31de2014-02-04 12:02:43 -080011if [ -d ${RAMCLOUD_HOME} ]; then
12 echo "${RAMCLOUD_HOME} already exist, please rename or remove them."
13 exit 1
14fi
15
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070016# install dependencies
17sudo apt-get -y install build-essential git-core libcppunit-dev libboost-all-dev libpcre3-dev protobuf-compiler libprotobuf-dev libcrypto++-dev libevent-dev scons libssl-dev libzookeeper-mt-dev
18
yoshi94c2e562014-01-22 15:18:57 -080019# clone ramcloud
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070020git clone git://fiz.stanford.edu/git/ramcloud.git ${RAMCLOUD_HOME}
yoshi94c2e562014-01-22 15:18:57 -080021cd ${RAMCLOUD_HOME}
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070022git checkout master
23# Switch to release 1.0 + fix for newer gcc
24git reset --hard 6a3eb98ae14ec6f732f06775220287c7245f5ff0
25# bug fix for MultiWrite, make zookeeper path configurable. (TODO send this patch to upstream)
26git apply ${ONOS_HOME}/ramcloud-build-scripts/ramcloud.patch
Yuta HIGUCHI23efab32014-04-28 15:34:41 -070027git apply ${ONOS_HOME}/ramcloud-build-scripts/increment_fix.patch
yoshi94c2e562014-01-22 15:18:57 -080028
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070029mkdir ${RAMCLOUD_HOME}/private
30cp -vf ${ONOS_HOME}/ramcloud-build-scripts/MakefragPrivateTop ${RAMCLOUD_HOME}/private/MakefragPrivateTop
yoshi94c2e562014-01-22 15:18:57 -080031
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070032# download submodule (logcabin, gtest)
yoshi94c2e562014-01-22 15:18:57 -080033git submodule update --init --recursive
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070034# cherry-pick logcabin bug fix
35cd logcabin
36 git cherry-pick --no-commit 77f0ea2da82e7abe71bb4caf084aa527de6dea50 3862499f477d0e371950aebcb829ddd8ee194962
37 git apply ${ONOS_HOME}/ramcloud-build-scripts/logcabin.patch
38cd ..
39
40# compile logcabin
yoshi94c2e562014-01-22 15:18:57 -080041make logcabin
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070042# compile ramcloud
43make DEBUG=no "$@"
yoshi94c2e562014-01-22 15:18:57 -080044
yoshi94c2e562014-01-22 15:18:57 -080045
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070046# build ramcloud JNI lib
47${ONOS_HOME}/build-ramcloud-java-bindings.sh
Yuta HIGUCHI30e31de2014-02-04 12:02:43 -080048