2015-02-03 08:50:32 +03:00
|
|
|
dnl -*- shell-script -*-
|
|
|
|
dnl
|
|
|
|
dnl Copyright (c) 2001-2011 Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
|
|
|
|
dnl Copyright (c) 2015 Research Organization for Information Science
|
|
|
|
dnl and Technology (RIST). All rights reserved.
|
|
|
|
dnl $COPYRIGHT$
|
|
|
|
dnl
|
|
|
|
dnl Additional copyrights may follow
|
|
|
|
dnl
|
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
2011-07-26 08:36:21 +04:00
|
|
|
|
|
|
|
# OMPI_CHECK_MXM(prefix, [action-if-found], [action-if-not-found])
|
|
|
|
# --------------------------------------------------------
|
2015-06-24 06:59:57 +03:00
|
|
|
# check if MXM support can be found. sets prefix_{CPPFLAGS,
|
2011-07-26 08:36:21 +04:00
|
|
|
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
|
|
|
|
# support, otherwise executes action-if-not-found
|
|
|
|
AC_DEFUN([OMPI_CHECK_MXM],[
|
|
|
|
AC_ARG_WITH([mxm],
|
|
|
|
[AC_HELP_STRING([--with-mxm(=DIR)],
|
2015-08-13 05:03:23 +03:00
|
|
|
[Build Mellanox Messaging support, optionally adding
|
|
|
|
DIR/include and DIR/lib or DIR/lib64 to the search path for headers and libraries])])
|
2011-07-26 08:36:21 +04:00
|
|
|
AC_ARG_WITH([mxm-libdir],
|
|
|
|
[AC_HELP_STRING([--with-mxm-libdir=DIR],
|
2015-08-13 05:03:23 +03:00
|
|
|
[Search for Mellanox MXM libraries in DIR])])
|
2014-05-01 19:38:07 +04:00
|
|
|
OPAL_CHECK_WITHDIR([mxm-libdir], [$with_mxm_libdir], [libmxm.*])
|
2011-07-26 08:36:21 +04:00
|
|
|
|
|
|
|
ompi_check_mxm_$1_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
ompi_check_mxm_$1_save_LDFLAGS="$LDFLAGS"
|
|
|
|
ompi_check_mxm_$1_save_LIBS="$LIBS"
|
|
|
|
|
|
|
|
AS_IF([test "$with_mxm" != "no"],
|
2015-02-03 08:50:32 +03:00
|
|
|
[AS_IF([test ! -z "$with_mxm" && test "$with_mxm" != "yes"],
|
2013-12-20 15:15:41 +04:00
|
|
|
[
|
|
|
|
ompi_check_mxm_dir="$with_mxm"
|
|
|
|
])
|
2015-02-03 08:50:32 +03:00
|
|
|
AS_IF([test ! -z "$with_mxm_libdir" && test "$with_mxm_libdir" != "yes"],
|
2011-07-26 08:36:21 +04:00
|
|
|
[ompi_check_mxm_libdir="$with_mxm_libdir"])
|
|
|
|
|
2014-05-01 18:24:56 +04:00
|
|
|
OPAL_CHECK_PACKAGE([$1],
|
2011-07-26 08:36:21 +04:00
|
|
|
[mxm/api/mxm_api.h],
|
|
|
|
[mxm],
|
|
|
|
[mxm_cleanup],
|
2015-08-13 05:03:23 +03:00
|
|
|
[],
|
2011-07-26 08:36:21 +04:00
|
|
|
[$ompi_check_mxm_dir],
|
|
|
|
[$ompi_check_mxm_libdir],
|
|
|
|
[ompi_check_mxm_happy="yes"],
|
|
|
|
[ompi_check_mxm_happy="no"])],
|
|
|
|
[ompi_check_mxm_happy="no"])
|
|
|
|
|
2013-12-05 16:25:52 +04:00
|
|
|
|
|
|
|
|
2011-07-26 08:36:21 +04:00
|
|
|
CPPFLAGS="$ompi_check_mxm_$1_save_CPPFLAGS"
|
|
|
|
LDFLAGS="$ompi_check_mxm_$1_save_LDFLAGS"
|
|
|
|
LIBS="$ompi_check_mxm_$1_save_LIBS"
|
|
|
|
|
2013-12-05 16:25:52 +04:00
|
|
|
AC_MSG_CHECKING(for MXM version compatibility)
|
|
|
|
AC_REQUIRE_CPP
|
|
|
|
old_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS -I$ompi_check_mxm_dir/include"
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <mxm/api/mxm_version.h>]],
|
|
|
|
[[
|
2014-02-04 18:45:47 +04:00
|
|
|
#ifndef MXM_VERSION
|
2014-07-10 17:16:57 +04:00
|
|
|
#error "MXM Version is less than 2.1, please upgrade"
|
2014-02-04 18:45:47 +04:00
|
|
|
#endif
|
|
|
|
#
|
2014-07-10 17:16:57 +04:00
|
|
|
#if MXM_API < MXM_VERSION(2,1)
|
|
|
|
#error "MXM Version is less than 2.1, please upgrade"
|
2013-12-05 16:25:52 +04:00
|
|
|
#endif
|
|
|
|
]])],
|
|
|
|
[ompi_mxm_version_ok="yes"],
|
|
|
|
[ompi_mxm_version_ok="no"])
|
|
|
|
|
|
|
|
AC_MSG_RESULT([$ompi_mxm_version_ok])
|
|
|
|
CFLAGS=$old_CFLAGS
|
|
|
|
|
|
|
|
AS_IF([test "$ompi_mxm_version_ok" = "no"], [ompi_check_mxm_happy="no"])
|
|
|
|
|
2011-07-26 08:36:21 +04:00
|
|
|
AS_IF([test "$ompi_check_mxm_happy" = "yes"],
|
|
|
|
[$2],
|
2015-02-03 08:50:32 +03:00
|
|
|
[AS_IF([test ! -z "$with_mxm" && test "$with_mxm" != "no"],
|
2011-07-26 08:36:21 +04:00
|
|
|
[AC_MSG_ERROR([MXM support requested but not found. Aborting])])
|
|
|
|
$3])
|
|
|
|
])
|
|
|
|
|