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 |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 27 | |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 28 | mkdir ${RAMCLOUD_HOME}/private |
| 29 | cp -vf ${ONOS_HOME}/ramcloud-build-scripts/MakefragPrivateTop ${RAMCLOUD_HOME}/private/MakefragPrivateTop |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 30 | |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 31 | # download submodule (logcabin, gtest) |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 32 | git submodule update --init --recursive |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 33 | # cherry-pick logcabin bug fix |
| 34 | cd logcabin |
| 35 | git cherry-pick --no-commit 77f0ea2da82e7abe71bb4caf084aa527de6dea50 3862499f477d0e371950aebcb829ddd8ee194962 |
| 36 | git apply ${ONOS_HOME}/ramcloud-build-scripts/logcabin.patch |
| 37 | cd .. |
| 38 | |
| 39 | # compile logcabin |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 40 | make logcabin |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 41 | # compile ramcloud |
| 42 | make DEBUG=no "$@" |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 43 | |
yoshi | 94c2e56 | 2014-01-22 15:18:57 -0800 | [diff] [blame] | 44 | |
Yuta HIGUCHI | a7ec073 | 2014-03-10 16:01:06 -0700 | [diff] [blame] | 45 | # build ramcloud JNI lib |
| 46 | ${ONOS_HOME}/build-ramcloud-java-bindings.sh |
Yuta HIGUCHI | 30e31de | 2014-02-04 12:02:43 -0800 | [diff] [blame] | 47 | |