Commit 044bb175 authored by Denis Barakthanov's avatar Denis Barakthanov Committed by Jim Harris
Browse files

bdev/daos: support custom DAOS installation dir



./configure --with-daos=[DIR] now accepts DAOS installation directory.

Signed-off-by: default avatarDenis Barakhtanov <denis.barahtanov@croit.io>
Change-Id: I16f4e0e41e6f73a32dec452c20aa7b558ca50f33
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14522


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent d326389d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ CONFIG_RBD=n
# Build DAOS support in bdev modules
# Requires daos development libraries
CONFIG_DAOS=n
CONFIG_DAOS_DIR=

# Build vhost library.
CONFIG_VHOST=y
+12 −2
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ function usage() {
	echo " --without-fc              If an argument is provided, it is considered a directory containing"
	echo "                           libufc.a and fc_lld.h. Otherwise the regular system paths will"
	echo "                           be searched."
	echo " --with-daos               Build DAOS bdev module."
	echo " --with-daos[=DIR]         Build DAOS bdev module."
	echo " --without-daos            No path required."
	echo " --with-shared             Build spdk shared libraries."
	echo " --without-shared          No path required."
@@ -488,6 +488,12 @@ for i in "$@"; do
			;;
		--with-daos)
			CONFIG[DAOS]=y
			CONFIG[DAOS_DIR]=""
			;;
		--with-daos=*)
			CONFIG[DAOS]=y
			check_dir "$i"
			CONFIG[DAOS_DIR]=$(readlink -f ${i#*=})
			;;
		--without-daos)
			CONFIG[DAOS]=n
@@ -1049,9 +1055,13 @@ if [[ "${CONFIG[ISCSI_INITIATOR]}" = "y" ]]; then
fi

if [[ "${CONFIG[DAOS]}" = "y" ]]; then
	daos_build_cmd=("${BUILD_CMD[@]}")
	if [[ -n "${CONFIG[DAOS_DIR]}" ]]; then
		daos_build_cmd+=(-I"${CONFIG[DAOS_DIR]}"/include -L"${CONFIG[DAOS_DIR]}"/lib64)
	fi
	if ! echo -e '#include <daos.h>\n#include <daos_fs.h>\n' \
		'int main(void) { return 0; }\n' \
		| "${BUILD_CMD[@]}" -lgurt -ldaos -ldaos_common -ldfs - 2> /dev/null; then
		| "${daos_build_cmd[@]}" -lgurt -ldaos -ldaos_common -ldfs - 2> /dev/null; then
		echo "--with-daos requires libdaos, libdaos_common, libdfs and libgurt"
		echo "Please install then re-run this script."
		exit 1
+7 −0
Original line number Diff line number Diff line
@@ -206,6 +206,13 @@ LDFLAGS += -L$(XNVME_INSTALL_DIR)
SYS_LIBS += -lxnvme
endif

ifeq ($(CONFIG_DAOS),y)
ifneq ($(CONFIG_DAOS_DIR),)
CFLAGS += -I$(CONFIG_DAOS_DIR)/include
LDFLAGS += -L$(CONFIG_DAOS_DIR)/lib64
endif
endif

#Attach only if FreeBSD and RDMA is specified with configure
ifeq ($(OS),FreeBSD)
ifeq ($(CONFIG_RDMA),y)