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