blob: 5ab945b209aa8afd64fc7aa03c900d3180da2340 [file] [log] [blame]
set -eu -o pipefail
# install prerequisites for stratum/bmv2 build
USE_STRATUM=true DEBUG_FLAGS=false FAST_BUILD=true CLEAN_UP=true bash /tmp/install-p4-tools.sh
# install bazel
BAZEL_VERSION="0.20.0"
curl -L -o bazel.sh -s https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
chmod +x bazel.sh
./bazel.sh --user
export PATH=/home/sdn/bin:$PATH
bazel version
# unroll the stratum tar ball from the build machine
cd ~/stratum
rm -rf *
tar xf /tmp/stratum-sources.tar
cd stratum
export BMV2_INSTALL=/usr/local
# build stratum
bazel build //stratum/hal/bin/bmv2:stratum_bmv2 --incompatible_remove_native_http_archive=false
# deploy stratum binaries to where mininet will look for them
mkdir -p /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2
cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2
mkdir -p /home/sdn/stratum/stratum/hal/bin/bmv2
cp 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