From 14a62d67ac03c9825cf8c5d5f94f0458bc139f67 Mon Sep 17 00:00:00 2001 From: Tomasz Kulasek Date: Wed, 26 Sep 2018 03:57:32 -0400 Subject: [PATCH] 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: Tomasz Kulasek Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456461 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- configure | 12 ++++++++++++ mk/spdk.modules.mk | 6 ++---- test/common/autotest_common.sh | 8 ++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/configure b/configure index b89ddf4291..4760c33295 100755 --- a/configure +++ b/configure @@ -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 \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 \n#include \n' \ 'int main(void) { return 0; }\n' \ diff --git a/mk/spdk.modules.mk b/mk/spdk.modules.mk index 887fc667e1..712842e4b0 100644 --- a/mk/spdk.modules.mk +++ b/mk/spdk.modules.mk @@ -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 diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 19e7192e43..3ea9d76892 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -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'