Commit 14a62d67 authored by Tomasz Kulasek's avatar Tomasz Kulasek Committed by Ben Walker
Browse files

net/vpp: allow to compile with vpp



This patch prepares environment to allow compile applications and
libraries with VPP.

Change-Id: Icc067c17b57932062afa5e6a67791bd58de3a2cc
Signed-off-by: default avatarTomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456461


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent a44c7434
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -520,6 +520,18 @@ if [[ "${CONFIG[REDUCE]}" = "y" ]]; then
	fi
fi

if [[ "${CONFIG[VPP]}" = "y" ]]; then
	if [ ! -z "${CONFIG[VPP_DIR]}" ]; then
		VPP_CFLAGS="-L${CONFIG[VPP_DIR]}/lib -I${CONFIG[VPP_DIR]}/include"
	fi
	if ! echo -e '#include <vnet/session/application_interface.h>\nint main(void) { return 0; }\n' \
		| $BUILD_CMD ${VPP_CFLAGS} -lvppinfra -lsvm -lvlibmemoryclient - 2>/dev/null; then
		echo --with-vpp requires installed vpp.
		echo Please install then re-run this script.
		exit 1
	fi
fi

if [[ "${CONFIG[RBD]}" = "y" ]]; then
	if ! echo -e '#include <rbd/librbd.h>\n#include <rados/librados.h>\n' \
		'int main(void) { return 0; }\n' \
+2 −4
Original line number Diff line number Diff line
@@ -91,11 +91,9 @@ SOCK_MODULES_LIST = sock_posix
ifeq ($(CONFIG_VPP),y)
SYS_LIBS += -Wl,--whole-archive
ifneq ($(CONFIG_VPP_DIR),)
SYS_LIBS += -l:libvppinfra.a -l:libsvm.a -l:libvapiclient.a
SYS_LIBS += -l:libvppcom.a -l:libvlibmemoryclient.a
else
SYS_LIBS += -lvppcom
SYS_LIBS += -L$(CONFIG_VPP_DIR)/lib
endif
SYS_LIBS += -lvppinfra -lsvm -lvlibmemoryclient
SYS_LIBS += -Wl,--no-whole-archive
SOCK_MODULES_LIST += sock_vpp
endif
+8 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ export RUN_NIGHTLY_FAILING
: ${SPDK_TEST_LVOL=0}; export SPDK_TEST_LVOL
: ${SPDK_TEST_JSON=0}; export SPDK_TEST_JSON
: ${SPDK_TEST_REDUCE=0}; export SPDK_TEST_REDUCE
: ${SPDK_TEST_VPP=0}; export SPDK_TEST_VPP
: ${SPDK_RUN_ASAN=0}; export SPDK_RUN_ASAN
: ${SPDK_RUN_UBSAN=0}; export SPDK_RUN_UBSAN
: ${SPDK_RUN_INSTALLED_DPDK=0}; export SPDK_RUN_INSTALLED_DPDK
@@ -175,6 +176,13 @@ if [ -d /usr/include/rbd ] && [ -d /usr/include/rados ] && [ $SPDK_TEST_RBD -eq
	fi
fi

if [ $SPDK_TEST_VPP -eq 1 ]; then
	VPP_PATH="/usr/local/src/vpp/build-root/install-vpp_debug-native/vpp/"
	export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${VPP_PATH}/lib/
	export PATH=${PATH}:${VPP_PATH}/bin/
	config_params+=" --with-vpp=${VPP_PATH}"
fi

# for options with no required dependencies, just test flags, set them here
if [ $SPDK_TEST_CRYPTO -eq 1 ]; then
	config_params+=' --with-crypto'