2005-07-13 05:07:31 +04:00
|
|
|
# -*- shell-script -*-
|
|
|
|
#
|
2005-11-05 22:57:48 +03:00
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
2005-07-13 05:07:31 +04:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
# University of Stuttgart. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
# OMPI_CHECK_MVAPI(prefix, [action-if-found], [action-if-not-found])
|
|
|
|
# --------------------------------------------------------
|
|
|
|
# check if MVAPI support can be found. sets prefix_{CPPFLAGS,
|
|
|
|
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
|
|
|
|
# support, otherwise executes action-if-not-found
|
|
|
|
AC_DEFUN([OMPI_CHECK_MVAPI],[
|
|
|
|
AC_ARG_WITH([mvapi],
|
2005-12-20 03:47:36 +03:00
|
|
|
[AC_HELP_STRING([--with-mvapi(=DIR)],
|
|
|
|
[Build MVAPI (InfiniBand) support, searching for libraries in DIR])])
|
2005-07-13 05:07:31 +04:00
|
|
|
AC_ARG_WITH([mvapi-libdir],
|
2005-12-20 03:47:36 +03:00
|
|
|
[AC_HELP_STRING([--with-mvapi-libdir=DIR],
|
|
|
|
[Search for MVAPI (InfiniBand) libraries in DIR/lib and DIR/lib64
|
|
|
|
in addition to other search paths])])
|
2005-07-13 05:07:31 +04:00
|
|
|
|
2005-09-23 17:18:41 +04:00
|
|
|
AS_IF([test ! -z "$with_mvapi" -a "$with_mvapi" != "yes"],
|
|
|
|
[ompi_check_mvapi_dir="$with_mvapi"])
|
|
|
|
AS_IF([test ! -z "$with_mvapi_libdir" -a "$with_mvapi_libdir" != "yes"],
|
|
|
|
[ompi_check_mvapi_libdir="$with_mvapi_libdir"])
|
2005-07-13 05:07:31 +04:00
|
|
|
|
2005-12-20 03:47:36 +03:00
|
|
|
AS_IF([test "$with_mvapi" != "no"],
|
|
|
|
[ # check for pthreads and emit a warning that
|
|
|
|
# things might go south...
|
|
|
|
AS_IF([test "$HAVE_POSIX_THREADS" != "1"],
|
|
|
|
[AC_MSG_WARN([POSIX threads not enabled. May not be able to link with mvapi])])
|
2005-08-08 23:10:36 +04:00
|
|
|
|
2005-12-20 03:47:36 +03:00
|
|
|
ompi_check_mvapi$1_save_CFLAGS="$CFLAGS"
|
|
|
|
ompi_check_mvapi$1_save_CPPFLAGS="$CPPFLAGS"
|
2005-08-08 23:10:36 +04:00
|
|
|
|
2005-12-20 03:47:36 +03:00
|
|
|
# ugly hack for topspin which stores include files in include/vapi
|
|
|
|
AS_IF([test -d "$ompi_check_mvapi_dir/include/vapi"],
|
|
|
|
[CPPFLAGS="$CPPFLAGS -I $ompi_check_mvapi_dir/include/vapi"
|
|
|
|
$1_CPPFLAGS="$$1_CPPFLAGS -I $ompi_check_mvapi_dir/include/vapi"])
|
2005-08-08 23:10:36 +04:00
|
|
|
|
2005-12-20 03:47:36 +03:00
|
|
|
# some mellanox vapi implemenations only need lvapi and lmosal
|
|
|
|
OMPI_CHECK_PACKAGE([$1],
|
|
|
|
[vapi.h],
|
|
|
|
[vapi],
|
|
|
|
[VAPI_open_hca],
|
|
|
|
[-lmosal],
|
|
|
|
[$ompi_check_mvapi_dir],
|
|
|
|
[$ompi_check_mvapi_libdir],
|
|
|
|
[ompi_check_mvapi_happy="yes"],
|
|
|
|
[ompi_check_mvapi_happy="no"])
|
2005-08-08 23:10:36 +04:00
|
|
|
|
2005-12-20 03:47:36 +03:00
|
|
|
# if needed use both lmpga and lmtl_common
|
|
|
|
AS_IF([test "$ompi_check_mvapi_happy" = "no"],
|
|
|
|
[OMPI_CHECK_PACKAGE([$1],
|
|
|
|
[vapi.h],
|
|
|
|
[vapi],
|
|
|
|
[VAPI_open_hca],
|
|
|
|
[-lmosal -lmpga -lmtl_common],
|
|
|
|
[$ompi_check_mvapi_dir],
|
|
|
|
[$ompi_check_mvapi_libdir],
|
|
|
|
[ompi_check_mvapi_happy="yes"],
|
|
|
|
[ompi_check_mvapi_happy="no"])])
|
|
|
|
|
|
|
|
CPPFLAGS="$ompi_check_mvapi$1_save_CPPFLAGS"],
|
|
|
|
[ompi_check_mvapi_happy="no"])
|
2005-07-13 05:07:31 +04:00
|
|
|
|
|
|
|
AS_IF([test "$ompi_check_mvapi_happy" = "yes"],
|
|
|
|
[$2],
|
2005-09-23 17:18:41 +04:00
|
|
|
[AS_IF([test ! -z "$with_mvapi" -a "$with_mvapi" != "no"],
|
2005-07-13 05:07:31 +04:00
|
|
|
[AC_MSG_ERROR([MVAPI support requested but not found. Aborting])])
|
|
|
|
$3])
|
|
|
|
])
|
|
|
|
|