blob: 4cdd8a62a0a9626df91a1a6385ae6ec798a9228b [file] [log] [blame]
Ray Milkey9713d152019-03-27 15:47:58 -07001set -eu -o pipefail
2
3# install prerequisites for stratum/bmv2 build
4USE_STRATUM=true DEBUG_FLAGS=false FAST_BUILD=true CLEAN_UP=true bash /tmp/install-p4-tools.sh
5
6# install bazel
Carmelo Cascone1537e8e2019-06-28 14:30:05 -07007BAZEL_VERSION="0.23.2"
Ray Milkey9713d152019-03-27 15:47:58 -07008curl -L -o bazel.sh -s https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
9chmod +x bazel.sh
10./bazel.sh --user
11export PATH=/home/sdn/bin:$PATH
12bazel version
13
14# unroll the stratum tar ball from the build machine
15cd ~/stratum
16rm -rf *
17tar xf /tmp/stratum-sources.tar
18cd stratum
19export BMV2_INSTALL=/usr/local
20
21# build stratum
Carmelo Cascone1537e8e2019-06-28 14:30:05 -070022bazel build //stratum/hal/bin/bmv2:stratum_bmv2
Ray Milkey9713d152019-03-27 15:47:58 -070023
24# deploy stratum binaries to where mininet will look for them
25mkdir -p /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2
26cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2
27
28mkdir -p /home/sdn/stratum/stratum/hal/bin/bmv2
29cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2.runfiles/com_github_stratum_stratum/stratum/hal/bin/bmv2/dummy.json /home/sdn/stratum/stratum/hal/bin/bmv2
30