- AC_HELP_STRING([--with-mx=path],
- [build mxlnd against path]),
- [
- case $with_mx in
- yes) ENABLEMX=2
- ;;
- no) ENABLEMX=0
- ;;
- *) MXPATH=$with_mx
- ENABLEMX=3
- ;;
- esac
- ],[
- ENABLEMX=1
- ])
-if test $ENABLEMX -eq 0; then
- AC_MSG_RESULT([disabled])
-elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \
- -f ${MXPATH}/include/mx_kernel_api.h -a \
- -f ${MXPATH}/include/mx_pin.h \); then
- AC_MSG_RESULT([no])
- case $ENABLEMX in
- 1) ;;
- 2) AC_MSG_ERROR([Myrinet MX kernel headers not present]);;
- 3) AC_MSG_ERROR([bad --with-mx path]);;
- *) AC_MSG_ERROR([internal error]);;
- esac
-else
- MXCPPFLAGS="-I$MXPATH/include"
- EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
- EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS"
- MXLIBS="-L$MXPATH/lib"
- LB_LINUX_TRY_COMPILE([
- #define MX_KERNEL 1
- #include <mx_extensions.h>
- #include <myriexpress.h>
- ],[
- mx_endpoint_t end;
- mx_status_t status;
- mx_request_t request;
- int result;
-
- mx_init();
- mx_open_endpoint(MX_ANY_NIC, MX_ANY_ENDPOINT, 0, NULL, 0, &end);
- mx_register_unexp_handler(end, (mx_unexp_handler_t) NULL, NULL);
- mx_wait_any(end, MX_INFINITE, 0LL, 0LL, &status, &result);
- mx_iconnect(end, 0LL, 0, 0, 0, NULL, &request);
- return 0;
- ],[
- AC_MSG_RESULT([yes])
- MXLND="mxlnd"
- ],[
- AC_MSG_RESULT([no])
- case $ENABLEMX in
- 1) ;;
- 2) AC_MSG_ERROR([can't compile with Myrinet MX kernel headers]);;
- 3) AC_MSG_ERROR([can't compile with Myrinet MX headers under $MXPATH]);;
- *) AC_MSG_ERROR([internal error]);;
- esac
- MXLND=""
- MXCPPFLAGS=""
- ])
- EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
-fi
-AC_SUBST(MXCPPFLAGS)
-AC_SUBST(MXLIBS)
-AC_SUBST(MXLND)
-])
-
-
-
-#
-# LN_CONFIG_O2IB
-#
-AC_DEFUN([LN_CONFIG_O2IB],[
-AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
-# set default
-O2IBPATH="$LINUX/drivers/infiniband"
-AC_ARG_WITH([o2ib],
- AC_HELP_STRING([--with-o2ib=path],
- [build o2iblnd against path]),
- [
- case $with_o2ib in
- yes) ENABLEO2IB=2
- ;;
- no) ENABLEO2IB=0
- ;;
- *) O2IBPATH=$with_o2ib
- ENABLEO2IB=3
- ;;
- esac
- ],[
- ENABLEO2IB=1
- ])
-if test $ENABLEO2IB -eq 0; then
- AC_MSG_RESULT([disabled])
-elif test ! \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
- -f ${O2IBPATH}/include/rdma/ib_cm.h -a\
- -f ${O2IBPATH}/include/rdma/ib_verbs.h -a\
- -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
- AC_MSG_RESULT([no])
- case $ENABLEO2IB in
- 1) ;;
- 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
- 3) AC_MSG_ERROR([bad --with-o2ib path]);;
- *) AC_MSG_ERROR([internal error]);;
- esac
-else
- O2IBCPPFLAGS="-I$O2IBPATH/include"
- EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
- EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS"
- EXTRA_LNET_INCLUDE="$O2IBCPPFLAGS $EXTRA_LNET_INCLUDE"
- LB_LINUX_TRY_COMPILE([
- #include <linux/version.h>
- #include <linux/pci.h>
- #if !HAVE_GFP_T
- typedef int gfp_t;
- #endif
- #include <rdma/rdma_cm.h>
- #include <rdma/ib_cm.h>
- #include <rdma/ib_verbs.h>
- #include <rdma/ib_fmr_pool.h>
- ],[
- struct rdma_cm_id *cm_id;
- struct rdma_conn_param conn_param;
- struct ib_device_attr device_attr;
- struct ib_qp_attr qp_attr;
- struct ib_pool_fmr pool_fmr;
- enum ib_cm_rej_reason rej_reason;
-
- cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
- return PTR_ERR(cm_id);
- ],[
- AC_MSG_RESULT([yes])
- O2IBLND="o2iblnd"
- ],[
- AC_MSG_RESULT([no])
- case $ENABLEO2IB in
- 1) ;;
- 2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);;
- 3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);;
- *) AC_MSG_ERROR([internal error]);;
- esac
- O2IBLND=""
- O2IBCPPFLAGS=""
- ])
-
-# version checking is a hack and isn't reliable, we need verify it
-# with each new ofed release
-
- IB_DMA_MAP="`grep -c ib_dma_map_single ${O2IBPATH}/include/rdma/ib_verbs.h`"
- if test "$IB_DMA_MAP" != 0 ; then
- IB_COMP_VECT="`grep -c comp_vector ${O2IBPATH}/include/rdma/ib_verbs.h`"
- if test "$IB_COMP_VECT" != 0 ; then
- IBLND_OFED_VERSION="1025"
- else
- IBLND_OFED_VERSION="1020"
- fi
- else
- IBLND_OFED_VERSION="1010"
- fi
-
- AC_DEFINE_UNQUOTED(IBLND_OFED_VERSION, $IBLND_OFED_VERSION,
- [OFED version])
-
- EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
-fi
-
-AC_SUBST(EXTRA_LNET_INCLUDE)
-AC_SUBST(O2IBCPPFLAGS)
-AC_SUBST(O2IBLND)
-])
-
-#
-# LN_CONFIG_OPENIB
-#
-# check for OpenIB in the kernel
-AC_DEFUN([LN_CONFIG_OPENIB],[
-AC_MSG_CHECKING([whether to enable OpenIB support])
-# set default
-OPENIBPATH="$LINUX/drivers/infiniband"
-AC_ARG_WITH([openib],
- AC_HELP_STRING([--with-openib=path],
- [build openiblnd against path]),