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