diff --git a/autobuild.sh b/autobuild.sh index fa8c3f455..82df6fd76 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -15,6 +15,7 @@ source "$rootdir/test/common/autotest_common.sh" out=$output_dir scanbuild="scan-build -o $output_dir/scan-build-tmp --status-bugs" +config_params=$(get_config_params) rm -rf /tmp/spdk mkdir /tmp/spdk diff --git a/autopackage.sh b/autopackage.sh index 89540a5ba..913b8078a 100755 --- a/autopackage.sh +++ b/autopackage.sh @@ -35,7 +35,7 @@ fi timing_enter build_release -./configure $config_params --disable-debug --enable-lto +./configure $(get_config_params) --disable-debug --enable-lto $MAKE ${MAKEFLAGS} $MAKE ${MAKEFLAGS} clean diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 4846ad7e7..c08b5c17d 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -169,111 +169,6 @@ else exit 1 fi -config_params='--enable-debug --enable-werror' - -if echo -e "#include \nint main(int argc, char *argv[]) {return 0;}\n" | \ - gcc -o /dev/null -lunwind -x c - 2>/dev/null; then - config_params+=' --enable-log-bt' -fi - -# for options with dependencies but no test flag, set them here -if [ -f /usr/include/infiniband/verbs.h ]; then - config_params+=' --with-rdma' -fi - -if [[ -d $CONFIG_FIO_SOURCE_DIR ]]; then - config_params+=" --with-fio=$CONFIG_FIO_SOURCE_DIR" -fi - -if [ -d ${DEPENDENCY_DIR}/vtune_codes ]; then - config_params+=' --with-vtune='${DEPENDENCY_DIR}'/vtune_codes' -fi - -if [ -d /usr/include/iscsi ]; then - libiscsi_version=$(grep LIBISCSI_API_VERSION /usr/include/iscsi/iscsi.h | head -1 | awk '{print $3}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}') - if [ $libiscsi_version -ge 20150621 ]; then - config_params+=' --with-iscsi-initiator' - fi -fi - -if [ $SPDK_TEST_UNITTEST -eq 0 ]; then - config_params+=' --disable-unit-tests' -fi - -if [ $SPDK_TEST_NVME_CUSE -eq 1 ]; then - config_params+=' --with-nvme-cuse' -fi - -# for options with both dependencies and a test flag, set them here -if [ -f /usr/include/libpmemblk.h ] && [ $SPDK_TEST_PMDK -eq 1 ]; then - config_params+=' --with-pmdk' -fi - -if [ -f /usr/include/libpmem.h ] && [ $SPDK_TEST_REDUCE -eq 1 ]; then - if [ $SPDK_TEST_ISAL -eq 1 ]; then - config_params+=' --with-reduce' - else - echo "reduce not enabled because isal is not enabled." - fi -fi - -if [ -d /usr/include/rbd ] && [ -d /usr/include/rados ] && [ $SPDK_TEST_RBD -eq 1 ]; then - config_params+=' --with-rbd' -fi - -if [ $SPDK_TEST_VPP -eq 1 ]; then - VPP_PATH="/usr/local/src/vpp-19.04/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' -fi - -if [ $SPDK_TEST_OCF -eq 1 ]; then - config_params+=" --with-ocf" -fi - -if [ $SPDK_RUN_UBSAN -eq 1 ]; then - config_params+=' --enable-ubsan' -fi - -if [ $SPDK_RUN_ASAN -eq 1 ]; then - config_params+=' --enable-asan' -fi - -if [ "$(uname -s)" = "Linux" ]; then - config_params+=' --enable-coverage' -fi - -if [ $SPDK_TEST_ISAL -eq 0 ]; then - config_params+=' --without-isal' -fi - -if [ $SPDK_TEST_BLOBFS -eq 1 ]; then - if [[ -d /usr/include/fuse3 ]] || [[ -d /usr/local/include/fuse3 ]]; then - config_params+=' --with-fuse' - else - echo "FUSE not enabled because libfuse3 is not installed." - fi -fi - -if [ $SPDK_TEST_RAID5 -eq 1 ]; then - config_params+=' --with-raid5' -fi - -# By default, --with-dpdk is not set meaning the SPDK build will use the DPDK submodule. -# If a DPDK installation is found in a well-known location though, WITH_DPDK_DIR will be -# set which will override the default and use that DPDK installation instead. -if [ -n "$WITH_DPDK_DIR" ]; then - config_params+=" --with-dpdk=$WITH_DPDK_DIR" -fi - -export config_params - if [ -z "$output_dir" ]; then if [ -z "$rootdir" ] || [ ! -d "$rootdir/../output" ]; then output_dir=. @@ -306,6 +201,114 @@ if [[ -z $RPC_PIPE_PID ]] || ! kill -0 "$RPC_PIPE_PID" &>/dev/null; then # process, this will make rpc.py stop reading and exit gracefully fi +if [ $SPDK_TEST_VPP -eq 1 ]; then + VPP_PATH="/usr/local/src/vpp-19.04/build-root/install-vpp_debug-native/vpp/" + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${VPP_PATH}/lib/ + export PATH=${PATH}:${VPP_PATH}/bin/ +fi + +function get_config_params() { + xtrace_disable + config_params='--enable-debug --enable-werror' + + if echo -e "#include \nint main(int argc, char *argv[]) {return 0;}\n" | \ + gcc -o /dev/null -lunwind -x c - 2>/dev/null; then + config_params+=' --enable-log-bt' + fi + + # for options with dependencies but no test flag, set them here + if [ -f /usr/include/infiniband/verbs.h ]; then + config_params+=' --with-rdma' + fi + + if [[ -d $CONFIG_FIO_SOURCE_DIR ]]; then + config_params+=" --with-fio=$CONFIG_FIO_SOURCE_DIR" + fi + + if [ -d ${DEPENDENCY_DIR}/vtune_codes ]; then + config_params+=' --with-vtune='${DEPENDENCY_DIR}'/vtune_codes' + fi + + if [ -d /usr/include/iscsi ]; then + libiscsi_version=$(grep LIBISCSI_API_VERSION /usr/include/iscsi/iscsi.h | head -1 | awk '{print $3}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}') + if [ $libiscsi_version -ge 20150621 ]; then + config_params+=' --with-iscsi-initiator' + fi + fi + + if [ $SPDK_TEST_UNITTEST -eq 0 ]; then + config_params+=' --disable-unit-tests' + fi + + if [ $SPDK_TEST_NVME_CUSE -eq 1 ]; then + config_params+=' --with-nvme-cuse' + fi + + # for options with both dependencies and a test flag, set them here + if [ -f /usr/include/libpmemblk.h ] && [ $SPDK_TEST_PMDK -eq 1 ]; then + config_params+=' --with-pmdk' + fi + + if [ -f /usr/include/libpmem.h ] && [ $SPDK_TEST_REDUCE -eq 1 ]; then + if [ $SPDK_TEST_ISAL -eq 1 ]; then + config_params+=' --with-reduce' + fi + fi + + if [ -d /usr/include/rbd ] && [ -d /usr/include/rados ] && [ $SPDK_TEST_RBD -eq 1 ]; then + config_params+=' --with-rbd' + fi + + if [ $SPDK_TEST_VPP -eq 1 ]; then + 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' + fi + + if [ $SPDK_TEST_OCF -eq 1 ]; then + config_params+=" --with-ocf" + fi + + if [ $SPDK_RUN_UBSAN -eq 1 ]; then + config_params+=' --enable-ubsan' + fi + + if [ $SPDK_RUN_ASAN -eq 1 ]; then + config_params+=' --enable-asan' + fi + + if [ "$(uname -s)" = "Linux" ]; then + config_params+=' --enable-coverage' + fi + + if [ $SPDK_TEST_ISAL -eq 0 ]; then + config_params+=' --without-isal' + fi + + if [ $SPDK_TEST_BLOBFS -eq 1 ]; then + if [[ -d /usr/include/fuse3 ]] || [[ -d /usr/local/include/fuse3 ]]; then + config_params+=' --with-fuse' + fi + fi + + if [ $SPDK_TEST_RAID5 -eq 1 ]; then + config_params+=' --with-raid5' + fi + + # By default, --with-dpdk is not set meaning the SPDK build will use the DPDK submodule. + # If a DPDK installation is found in a well-known location though, WITH_DPDK_DIR will be + # set which will override the default and use that DPDK installation instead. + if [ -n "$WITH_DPDK_DIR" ]; then + config_params+=" --with-dpdk=$WITH_DPDK_DIR" + fi + + echo "$config_params" + xtrace_restore +} + function rpc_cmd() { xtrace_disable local rsp rc diff --git a/test/iscsi_tgt/ext4test/ext4test.sh b/test/iscsi_tgt/ext4test/ext4test.sh index f9430e88c..396b0ac69 100755 --- a/test/iscsi_tgt/ext4test/ext4test.sh +++ b/test/iscsi_tgt/ext4test/ext4test.sh @@ -91,7 +91,7 @@ for dev in $devs; do rsync -qav --exclude=".git" --exclude="*.o" $rootdir/ /mnt/${dev}dir/spdk make -C /mnt/${dev}dir/spdk clean - (cd /mnt/${dev}dir/spdk && ./configure $config_params) + (cd /mnt/${dev}dir/spdk && ./configure $(get_config_params)) make -C /mnt/${dev}dir/spdk -j16 # Print out space consumed on target device to help decide diff --git a/test/make/check_so_deps.sh b/test/make/check_so_deps.sh index ec2390c7a..f3e8411a1 100755 --- a/test/make/check_so_deps.sh +++ b/test/make/check_so_deps.sh @@ -165,6 +165,7 @@ function confirm_deps() { # symbol dependencies we have. sed -i -e 's,include $(SPDK_ROOT_DIR)/mk/spdk.lib_deps.mk,,g' "$rootdir/mk/spdk.lib.mk" +config_params=$(get_config_params) if [ "$SPDK_TEST_OCF" -eq 1 ]; then config_params="$config_params --with-ocf=$rootdir/build/ocf.a" fi