yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Yuta HIGUCHI | 4d70a01 | 2014-03-26 17:56:40 -0700 | [diff] [blame] | 3 | # fail on command error |
| 4 | set -e |
| 5 | # echo back each command |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 6 | set -x |
| 7 | |
Yuta HIGUCHI | 318d9d1 | 2014-04-10 17:00:32 -0700 | [diff] [blame] | 8 | export ONOS_HOME=${ONOS_HOME:-$(cd `dirname $0`; pwd)} |
| 9 | export RAMCLOUD_HOME=${RAMCLOUD_HOME:-~/ramcloud} |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 10 | |
Yuta HIGUCHI | 30e31de | 2014-02-04 12:02:43 -0800 | [diff] [blame] | 11 | if [ -d ${RAMCLOUD_HOME} ]; then |
| 12 | echo "${RAMCLOUD_HOME} already exist, please rename or remove them." |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 16 | # install dependencies |
| 17 | sudo 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 | |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 19 | # clone ramcloud |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 20 | git clone git://fiz.stanford.edu/git/ramcloud.git ${RAMCLOUD_HOME} |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 21 | cd ${RAMCLOUD_HOME} |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 22 | git checkout master |
| 23 | # Switch to release 1.0 + fix for newer gcc |
| 24 | git reset --hard 6a3eb98ae14ec6f732f06775220287c7245f5ff0 |
| 25 | # bug fix for MultiWrite, make zookeeper path configurable. (TODO send this patch to upstream) |
| 26 | git apply ${ONOS_HOME}/ramcloud-build-scripts/ramcloud.patch |
Yuta HIGUCHI | 23efab3 | 2014-04-28 15:34:41 -0700 | [diff] [blame] | 27 | git apply ${ONOS_HOME}/ramcloud-build-scripts/increment_fix.patch |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 28 | |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 29 | mkdir ${RAMCLOUD_HOME}/private |
| 30 | cp -vf ${ONOS_HOME}/ramcloud-build-scripts/MakefragPrivateTop ${RAMCLOUD_HOME}/private/MakefragPrivateTop |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 31 | |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 32 | # download submodule (logcabin, gtest) |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 33 | git submodule update --init --recursive |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 34 | # cherry-pick logcabin bug fix |
| 35 | cd logcabin |
| 36 | git cherry-pick --no-commit 77f0ea2da82e7abe71bb4caf084aa527de6dea50 3862499f477d0e371950aebcb829ddd8ee194962 |
| 37 | git apply ${ONOS_HOME}/ramcloud-build-scripts/logcabin.patch |
| 38 | cd .. |
| 39 | |
| 40 | # compile logcabin |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 41 | make logcabin |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 42 | # compile ramcloud |
| 43 | make DEBUG=no "$@" |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 44 | |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 45 | |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 46 | # build ramcloud JNI lib |
| 47 | ${ONOS_HOME}/build-ramcloud-java-bindings.sh |
Yuta HIGUCHI | 30e31de | 2014-02-04 12:02:43 -0800 | [diff] [blame] | 48 | |