blob: c34d64914d70de4c47307ec699b57c4446a81ce9 [file] [log] [blame]
yoshi94c2e562014-01-22 15:18:57 -08001#!/bin/sh
2
3set -x
4
Yuta HIGUCHI247a23c2014-02-21 09:21:14 -08005ONOS_HOME=${ONOS_HOME:-~/ONOS}
6RAMCLOUD_HOME=${RAMCLOUD_HOME:-~/ramcloud}
yoshi94c2e562014-01-22 15:18:57 -08007
Yuta HIGUCHI30e31de2014-02-04 12:02:43 -08008if [ -d ${RAMCLOUD_HOME} ]; then
9 echo "${RAMCLOUD_HOME} already exist, please rename or remove them."
10 exit 1
11fi
12
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070013# install dependencies
14sudo 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
15
yoshi94c2e562014-01-22 15:18:57 -080016# clone ramcloud
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070017git clone git://fiz.stanford.edu/git/ramcloud.git ${RAMCLOUD_HOME}
yoshi94c2e562014-01-22 15:18:57 -080018cd ${RAMCLOUD_HOME}
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070019git checkout master
20# Switch to release 1.0 + fix for newer gcc
21git reset --hard 6a3eb98ae14ec6f732f06775220287c7245f5ff0
22# bug fix for MultiWrite, make zookeeper path configurable. (TODO send this patch to upstream)
23git apply ${ONOS_HOME}/ramcloud-build-scripts/ramcloud.patch
yoshi94c2e562014-01-22 15:18:57 -080024
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070025mkdir ${RAMCLOUD_HOME}/private
26cp -vf ${ONOS_HOME}/ramcloud-build-scripts/MakefragPrivateTop ${RAMCLOUD_HOME}/private/MakefragPrivateTop
yoshi94c2e562014-01-22 15:18:57 -080027
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070028# download submodule (logcabin, gtest)
yoshi94c2e562014-01-22 15:18:57 -080029git submodule update --init --recursive
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070030# cherry-pick logcabin bug fix
31cd logcabin
32 git cherry-pick --no-commit 77f0ea2da82e7abe71bb4caf084aa527de6dea50 3862499f477d0e371950aebcb829ddd8ee194962
33 git apply ${ONOS_HOME}/ramcloud-build-scripts/logcabin.patch
34cd ..
35
36# compile logcabin
yoshi94c2e562014-01-22 15:18:57 -080037make logcabin
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070038# compile ramcloud
39make DEBUG=no "$@"
yoshi94c2e562014-01-22 15:18:57 -080040
yoshi94c2e562014-01-22 15:18:57 -080041
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070042# build ramcloud JNI lib
43${ONOS_HOME}/build-ramcloud-java-bindings.sh
Yuta HIGUCHI30e31de2014-02-04 12:02:43 -080044