bdev/daos: support custom DAOS installation dir

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

Signed-off-by: Denis Barakhtanov <denis.barahtanov@croit.io>
Change-Id: I16f4e0e41e6f73a32dec452c20aa7b558ca50f33
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14522
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Denis Barakthanov 2022-09-15 11:55:46 +01:00 committed by Jim Harris
parent d326389d96
commit 044bb17525
3 changed files with 20 additions and 2 deletions

1
CONFIG
View File

@ -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

14
configure vendored
View File

@ -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

View File

@ -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)