blob: 9a91cc280324633e779da86f31749453d49ec4ba [file] [log] [blame]
Yuta HIGUCHI9abcbc72014-06-03 00:45:54 -07001#!/bin/bash
yoshi94c2e562014-01-22 15:18:57 -08002
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 HIGUCHIe748ecc2014-05-28 13:55:03 -070011source ${ONOS_HOME}/scripts/common/utils.sh
12
13confirm-if-root
14
Yuta HIGUCHI30e31de2014-02-04 12:02:43 -080015if [ -d ${RAMCLOUD_HOME} ]; then
16 echo "${RAMCLOUD_HOME} already exist, please rename or remove them."
17 exit 1
18fi
19
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070020# install dependencies
21sudo 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
22
yoshi94c2e562014-01-22 15:18:57 -080023# clone ramcloud
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070024git clone git://fiz.stanford.edu/git/ramcloud.git ${RAMCLOUD_HOME}
yoshi94c2e562014-01-22 15:18:57 -080025cd ${RAMCLOUD_HOME}
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070026git checkout master
27# Switch to release 1.0 + fix for newer gcc
28git reset --hard 6a3eb98ae14ec6f732f06775220287c7245f5ff0
29# bug fix for MultiWrite, make zookeeper path configurable. (TODO send this patch to upstream)
30git apply ${ONOS_HOME}/ramcloud-build-scripts/ramcloud.patch
Yuta HIGUCHI23efab32014-04-28 15:34:41 -070031git apply ${ONOS_HOME}/ramcloud-build-scripts/increment_fix.patch
yoshi94c2e562014-01-22 15:18:57 -080032
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070033mkdir ${RAMCLOUD_HOME}/private
34cp -vf ${ONOS_HOME}/ramcloud-build-scripts/MakefragPrivateTop ${RAMCLOUD_HOME}/private/MakefragPrivateTop
yoshi94c2e562014-01-22 15:18:57 -080035
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070036# download submodule (logcabin, gtest)
yoshi94c2e562014-01-22 15:18:57 -080037git submodule update --init --recursive
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070038# cherry-pick logcabin bug fix
39cd logcabin
40 git cherry-pick --no-commit 77f0ea2da82e7abe71bb4caf084aa527de6dea50 3862499f477d0e371950aebcb829ddd8ee194962
41 git apply ${ONOS_HOME}/ramcloud-build-scripts/logcabin.patch
42cd ..
43
44# compile logcabin
yoshi94c2e562014-01-22 15:18:57 -080045make logcabin
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070046# compile ramcloud
47make DEBUG=no "$@"
yoshi94c2e562014-01-22 15:18:57 -080048
yoshi94c2e562014-01-22 15:18:57 -080049
Yuta HIGUCHIa7ec0732014-03-10 16:01:06 -070050# build ramcloud JNI lib
51${ONOS_HOME}/build-ramcloud-java-bindings.sh
Yuta HIGUCHI30e31de2014-02-04 12:02:43 -080052