blob: c374833909c46f3238f9b3df85abbe402ec066a0 [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
yoshi94c2e562014-01-22 15:18:57 -080027
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070028mkdir ${RAMCLOUD_HOME}/private
29cp -vf ${ONOS_HOME}/ramcloud-build-scripts/MakefragPrivateTop ${RAMCLOUD_HOME}/private/MakefragPrivateTop
yoshi94c2e562014-01-22 15:18:57 -080030
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070031# download submodule (logcabin, gtest)
yoshi94c2e562014-01-22 15:18:57 -080032git submodule update --init --recursive
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070033# cherry-pick logcabin bug fix
34cd logcabin
35 git cherry-pick --no-commit 77f0ea2da82e7abe71bb4caf084aa527de6dea50 3862499f477d0e371950aebcb829ddd8ee194962
36 git apply ${ONOS_HOME}/ramcloud-build-scripts/logcabin.patch
37cd ..
38
39# compile logcabin
yoshi94c2e562014-01-22 15:18:57 -080040make logcabin
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070041# compile ramcloud
42make DEBUG=no "$@"
yoshi94c2e562014-01-22 15:18:57 -080043
yoshi94c2e562014-01-22 15:18:57 -080044
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070045# build ramcloud JNI lib
46${ONOS_HOME}/build-ramcloud-java-bindings.sh
Yuta HIGUCHI30e31de2014-02-04 12:02:43 -080047