blob: 5ab945b209aa8afd64fc7aa03c900d3180da2340 [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
7BAZEL_VERSION="0.20.0"
8curl -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
22bazel build //stratum/hal/bin/bmv2:stratum_bmv2 --incompatible_remove_native_http_archive=false
23
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