Whamcloud - gitweb
LU-15888 build: Debian dkms-debs requires ed and libkeyutils
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
index daeb1cc..90b7700 100644 (file)
@@ -5,7 +5,7 @@
 AC_DEFUN([LN_CONFIG_BACKOFF], [
 AC_MSG_CHECKING([whether to enable tunable backoff TCP support])
 AC_ARG_ENABLE([backoff],
-       AC_HELP_STRING([--disable-backoff],
+       AS_HELP_STRING([--disable-backoff],
                [disable socknal tunable backoff]),
        [], [enable_backoff="yes"])
 AC_MSG_RESULT([$enable_backoff])
@@ -53,7 +53,7 @@ AC_DEFUN([LN_CONFIG_DLC], [
 AC_DEFUN([LN_CONFIG_O2IB], [
 AC_MSG_CHECKING([whether to use Compat RDMA])
 AC_ARG_WITH([o2ib],
-       AC_HELP_STRING([--with-o2ib=[yes|no|<path>]],
+       AS_HELP_STRING([--with-o2ib=[yes|no|<path>]],
                [build o2iblnd against path]),
        [], [with_o2ib="yes"])
 
@@ -80,7 +80,7 @@ Instead, if you want to build Lustre for your kernel's built-in I/B stack rather
                                AC_MSG_ERROR([
 It appears that you have multiple OFED versions installed.
 If you still want to build Lustre for your OFED I/B stack, you need to install a single version with its devel headers RPM.
-Instead, if you want to build Lustre for your kernel's built-in I/B stack rather than your installed OFED stack, either remove the OFED package(s) or use --with-o2ib=no.
+Instead, if you want to build Lustre for your in-kernel I/B stack rather than your installed external OFED stack, either remove the OFED package(s) or use --with-o2ib=no.
                                             ])
                        ])
                        if test -e $O2IBPATHS/${LINUXRELEASE}; then
@@ -206,18 +206,20 @@ AS_IF([test $ENABLEO2IB = "no"], [
                ])
                # we know at this point that the found OFED source is good
                O2IB_SYMVER=""
-               if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
-                       if test -f $O2IBPATH/Module.symvers; then
-                               O2IB_SYMVER=$O2IBPATH/Module.symvers;
-                               break;
-                       fi
-                       if test -n "$O2IB_SYMVER"; then
-                               AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path])
-                               EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
-                               AC_SUBST(EXTRA_SYMBOLS)
-                       else
-                               AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
-                       fi
+               if test -f $O2IBPATH/Module.symvers; then
+                       O2IB_SYMVER=$O2IBPATH/Module.symvers
+               elif test "x$SUSE_KERNEL" = "xyes"; then
+                       O2IB_SYMVER=$(find ${O2IBPATH}* -name Module.symvers)
+               elif test -f $LINUX_OBJ/Module.symvers; then
+                       # Debian symvers is in the arch tree
+                       O2IB_SYMVER=$LINUX_OBJ/Module.symvers
+               fi
+               if test -n "$O2IB_SYMVER"; then
+                       AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path])
+                       EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
+                       AC_SUBST(EXTRA_SYMBOLS)
+               else
+                       AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
                fi
 
                LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
@@ -597,7 +599,7 @@ AS_IF([test $ENABLEO2IB != "no"], [
 AC_DEFUN([LN_CONFIG_GNILND], [
 AC_MSG_CHECKING([whether to enable GNI lnd])
 AC_ARG_ENABLE([gni],
-       AC_HELP_STRING([--enable-gni],
+       AS_HELP_STRING([--enable-gni],
                [enable GNI lnd]),
        [], [enable_gni="no"])
 AC_MSG_RESULT([$enable_gni])
@@ -620,7 +622,7 @@ AS_IF([test "x$enable_gni" = xyes], [
        ],[
                GNILND="gnilnd"
        ],[
-               AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
+               AC_MSG_ERROR([cannot compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
        ])
        # at this point, we have gnilnd basic support,
        # now check for extra features
@@ -927,6 +929,43 @@ AC_DEFUN([LN_CONFIGURE], [
 AC_MSG_NOTICE([LNet core checks
 ==============================================================================])
 
+AC_ARG_WITH([cuda],
+       AS_HELP_STRING([--with-cuda=path],
+                       [Use a CUDA sources.]),
+       [LB_ARG_CANON_PATH([cuda], [CUDA_PATH])],
+       [CUDA_PATH=`ls -d1 /usr/src/nvidia-*/nvidia/ | tail -1`]
+)
+
+AC_ARG_WITH([gds],
+       AS_HELP_STRING([--with-gds=path],
+                       [Use a gds sources.]),
+       [LB_ARG_CANON_PATH([gds], [GDS_PATH])],
+       [GDS_PATH=`ls -d1 /usr/src/nvidia-fs* | tail -1`]
+)
+
+AS_IF([test -n "${CUDA_PATH}" && test -n "${GDS_PATH}"],[
+LB_CHECK_FILE([$CUDA_PATH/nv-p2p.h],
+       [
+       AC_MSG_RESULT([CUDA path is $CUDA_PATH])
+       AC_SUBST(CUDA_PATH)
+       ],
+       [AC_MSG_ERROR([CUDA sources don't found. nv-p2p.h don't exit])]
+)
+
+LB_CHECK_FILE([$GDS_PATH/nvfs-dma.h],
+       [
+       LB_CHECK_FILE([$GDS_PATH/config-host.h], [
+       AC_MSG_RESULT([GDS path is $GDS_PATH])
+       AC_SUBST(GDS_PATH)
+       AC_DEFINE(WITH_GDS, 1, "GDS build enabled")
+       ], [])
+       ],
+       [])
+],[
+       AC_MSG_WARN([CUDA or GDS sources not found. GDS support disabled])
+]
+)
+
 # lnet/utils/lnetconfig/liblnetconfig_netlink.c
 AS_IF([test "x$enable_dist" = xno], [
        PKG_CHECK_MODULES(LIBNL3, [libnl-genl-3.0 >= 3.1])
@@ -973,7 +1012,7 @@ AC_CHECK_FUNCS([strnlen])
 
 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
 AC_ARG_ENABLE(efence,
-       AC_HELP_STRING([--enable-efence],
+       AS_HELP_STRING([--enable-efence],
                [use efence library]),
        [], [enable_efence="no"])
 AC_MSG_RESULT([$enable_efence])