make-all.sh
Helper script to build and install the P4 Control Plane software.
Build flow
The make-all.sh script builds and installs Open vSwitch (OVS), and then
builds and installs the rest of P4 Control Plane.
Syntax
./make-all.sh \
[--help|-h] \
[--dry-run|-n] \
[--deps=DEPS | -D DEPS] \
[--host=HOSTDEPS | -H HOSTDEPS] \
[--ovs=OVS | -O OVS] \
[--prefix=PREFIX | -P PREFIX] \
[--sde=SDE | -S SDE] \
[--toolchain=TOOLFILE | -T TOOLFILE ] \
[--coverage] \
[--cxx=STD] \
[--jobs=NJOBS | -j NJOBS] \
[--no-build] \
[--no-krnlmon] \
[--no-ovs] \
[--p4ovs=MODE] \
[--target=dpdk|es2k|tofino] \
[--debug|--minsize|--reldeb|--release]
Command-line parameters
General
--help,-hDisplays usage information and exits.
--dry-run,-nDisplays the parameters that will be passed to CMake, and exits.
Paths
--deps=DEPS,-D DEPSDirectory in which the Stratum dependencies for the runtime system are installed.
P4 Control Plane will be linked with these libraries. Use this option instead of
--hostif are building for the native system (not cross-compiling). Supplies the value of theDEPEND_INSTALL_DIRlistfile variable. Defaults to the value of theDEPEND_INSTALLenvironment variable.--host=HOST,-H HOSTDirectory in which the Stratum dependencies for the development system are installed.
Only used when cross-compiling. Used to compile Protobufs to C++ during cross-compilation. Supplies the value of the
HOST_DEPEND_DIRlistfile variable. Defaults to the value of theHOST_INSTALLenvironment variable.--ovs=OVS,-O OVSDirectory in which Open vSwitch will be (or is) installed.
May be omitted if the
--no-ovsoption is specified. Specifies the value ofCMAKE_INSTALL_PREFIXfor the OVS build. Supplies the value of theOVS_INSTALL_DIRlistfile variable for the networking recipe (P4 Control Plane) build. May be the same as theprefixdirectory, in which case OVS and P4 Control Plane will be installed to the same directory tree. Defaults to the value of theOVS_INSTALLenvironment variable.--prefix=PREFIX,-P PREFIXDirectory in which P4 Control Plane will be installed. The directory will be created if it does not exist.
May be the same as the
--ovsoption, in which case OVS and P4 Control Plane will be installed to the same directory tree. Specifies the value of theCMAKE_INSTALL_PREFIXvariable when building P4 Control Plane.--sde=SDE,-S SDEDirectory in which the SDK for the P4 target is installed.
Supplies the value of the
SDE_INSTALL_DIRlistfile variable. Defaults to the value of theSDE_INSTALLenvironment variable.--toolchain=FILE,-T FILEPath to the CMake toolchain file.
Must be specified when cross-compiling. Specifies the value of the
CMAKE_TOOLCHAIN_FILEvariable. Defaults to the value of theCMAKE_TOOLCHAIN_FILEenvironment variable.
Options
--coverageInstrument build to measure unit test code coverage. Sets the
TEST_COVERAGElistfile option to TRUE.--cxx=STDC++ standard to be used by the compiler (11, 14, 17). Specifies the value of the
CXX_STANDARDlistfile variable.--jobs=NJOBS,-j NJOBSNumber of build threads. Specifies the value of the
-jCMake option. Defaults to 8 threads.--no-buildConfigures CMake to build P4 Control Plane, but does not build it. May still build OVS.
--no-krnlmonExcludes the Kernel Monitor from the build. Sets the
WITH_KRNLMONlistfile option to FALSE.--no-ovsExcludes OVS from the build. Sets the
WITH_OVSP4RTlistfile option to FALSE.--p4ovs=MODESpecifies the mode in which to build OvS. See P4OVS Modes for a list of values.
--target=TARGETSpecifies the target (
dpdk,es2k, ortofino) for which P4 Control Plane will be built. The target name is case-insensitive. Sets theTDI_TARGETlistfile variable. Defaults toDPDKif unspecified.
Build Types
--debugBuild with
-DCMAKE_BUILD_TYPE=Debug. The compiler settings will default to-g.--minsizeBuild with
-DCMAKE_BUILD_TYPE=MinSizeRel. The compiler settings will default to-Os -DNDEBUG.--reldebBuild with
-DCMAKE_BUILD_TYPE=RelWithDebInfo. The compiler settings will default to-O2 -g -DNDEBUG.--releaseBuild with
-DCMAKE_BUILD_TYPE=Release. The compiler settings will default to-O3 -DNDEBUG.
If no configuration is specified, the CMake listfile currently defaults to
RelWithDebInfo.
P4OVS Modes
noneBuild OVS in non-P4 mode.
ovsp4rtBuild OVS with the ovsp4rt library. OVS is built after P4 Control Plane.
p4ovsBuild OVS in legacy P4 mode. OVS is built before P4 Control Plane. (default)
stubsBuild OVS with the ovsp4rt stubs library. OVS is built after P4 Control Plane. Use this mode when building to run the OVS test suite.
Environment variables
CMAKE_TOOLCHAIN_FILEPath to the CMake toolchain file to be used. Specifies the value of the
CMAKE_TOOLCHAIN_FILEvariable. May be overridden by--toolchain=TOOLFILE. Must be defined when cross-compiling.DEPEND_INSTALLDirectory in which the Stratum dependencies for the runtime system are installed. Supplies the default value of the
--depsoption.HOST_INSTALLDirectory in which the Stratum dependencies for the development system are installed. Supplies the default value of the
--hostoption. Only used when cross-compiling.OVS_INSTALLDirectory in which Open vSwitch should be (or is) installed. Supplies the default value of the
--ovsoption.SDE_INSTALLDirectory in which the P4SDE for the target is installed. Supplies the default value of the
--sdeoption.SDKTARGETSYSROOTPath to the system root (sysroot) directory for the ARM Compute Complex (ACC) of the E2100 IPU. Must be defined when cross-compiling.