blob: e5564b1796dbc5e9c063e64ed7b33203d0a81cbf [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
Carmelo Casconefb992672019-07-09 10:26:01 -070020export PI_INSTALL=/usr/local
Ray Milkey9713d152019-03-27 15:47:58 -070021
22# build stratum
Carmelo Casconefb992672019-07-09 10:26:01 -070023bazel build --curses=no --color=no //stratum/hal/bin/bmv2:stratum_bmv2
Ray Milkey9713d152019-03-27 15:47:58 -070024
25# deploy stratum binaries to where mininet will look for them
26mkdir -p /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2
27cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2
28
29mkdir -p /home/sdn/stratum/stratum/hal/bin/bmv2
30cp 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
31