- AC_MSG_ERROR([Bad --with-gm path])
- ])
-
- AC_MSG_CHECKING([that GM has gm_register_memory_ex_phys()])
- LB_LINUX_TRY_COMPILE([
- #define GM_STRONG_TYPES 1
- #ifdef VERSION
- #undef VERSION
- #endif
- #include "gm.h"
- #include "gm_internal.h"
- ],[
- gm_status_t gmrc;
- struct gm_port *port = NULL;
- gm_u64_t phys = 0;
- gm_up_t pvma = 0;
-
- gmrc = gm_register_memory_ex_phys(port, phys, 100, pvma);
- return 0;
- ],[
- AC_MSG_RESULT([yes])
- ],[
- AC_MSG_RESULT([no.
-Please patch the GM sources as follows...
- cd $GM_SRC
- patch -p0 < $PWD/lnet/klnds/gmlnd/gm-reg-phys.patch
-...then rebuild and re-install them])
- AC_MSG_ERROR([Can't build GM without gm_register_memory_ex_phys()])
- ])
-
- EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
-fi
-AC_SUBST(GMCPPFLAGS)
-AC_SUBST(GMLIBS)
-AC_SUBST(GMLND)
-])
-
-
-#
-# LN_CONFIG_MX
-#
-AC_DEFUN([LN_CONFIG_MX],
-[AC_MSG_CHECKING([whether to enable Myrinet MX support])
-# set default
-MXPATH="/opt/mx"
-AC_ARG_WITH([mx],
- 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)