3 # Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 # University Research and Technology
5 # Corporation. All rights reserved.
6 # Copyright (c) 2004-2005 The University of Tennessee and The University
7 # of Tennessee Research Foundation. All rights
9 # Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10 # University of Stuttgart. All rights reserved.
11 # Copyright (c) 2004-2005 The Regents of the University of California.
12 # All rights reserved.
15 # Additional copyrights may follow
21 # OMPI_CHECK_MVAPI(prefix, [action-if-found], [action-if-not-found])
22 # --------------------------------------------------------
23 # check if MVAPI support can be found. sets prefix_{CPPFLAGS,
24 # LDFLAGS, LIBS} as needed and runs action-if-found if there is
25 # support, otherwise executes action-if-not-found
26 AC_DEFUN([OMPI_CHECK_MVAPI],[
28 [AC_HELP_STRING([--with-mvapi(=DIR)],
29 [Build MVAPI (InfiniBand) support, searching for libraries in DIR])])
30 AC_ARG_WITH([mvapi-libdir],
31 [AC_HELP_STRING([--with-mvapi-libdir=DIR],
32 [Search for MVAPI (InfiniBand) libraries in DIR])])
34 AS_IF([test ! -z "$with_mvapi" -a "$with_mvapi" != "yes"],
35 [ompi_check_mvapi_dir="$with_mvapi"])
36 AS_IF([test ! -z "$with_mvapi_libdir" -a "$with_mvapi_libdir" != "yes"],
37 [ompi_check_mvapi_libdir="$with_mvapi_libdir"])
39 AS_IF([test "$with_mvapi" != "no"],
40 [ # check for pthreads and emit a warning that
41 # things might go south...
42 AS_IF([test "$HAVE_POSIX_THREADS" != "1"],
43 [AC_MSG_WARN([POSIX threads not enabled. May not be able to link with mvapi])])
45 ompi_check_mvapi$1_save_CFLAGS="$CFLAGS"
46 ompi_check_mvapi$1_save_CPPFLAGS="$CPPFLAGS"
48 # ugly hack for topspin which stores include files in include/vapi
49 AS_IF([test -d "$ompi_check_mvapi_dir/include/vapi"],
50 [CPPFLAGS="$CPPFLAGS -I $ompi_check_mvapi_dir/include/vapi"
51 $1_CPPFLAGS="$$1_CPPFLAGS -I $ompi_check_mvapi_dir/include/vapi"])
53 # some mellanox vapi implemenations only need lvapi and lmosal
54 OMPI_CHECK_PACKAGE([$1],
59 [$ompi_check_mvapi_dir],
60 [$ompi_check_mvapi_libdir],
61 [ompi_check_mvapi_happy="yes"],
62 [ompi_check_mvapi_happy="no"])
64 # if needed use both lmpga and lmtl_common
65 AS_IF([test "$ompi_check_mvapi_happy" = "no"],
66 [OMPI_CHECK_PACKAGE([$1],
70 [-lmosal -lmpga -lmtl_common],
71 [$ompi_check_mvapi_dir],
72 [$ompi_check_mvapi_libdir],
73 [ompi_check_mvapi_happy="yes"],
74 [ompi_check_mvapi_happy="no"])])
76 AS_IF([test "$ompi_check_mvapi_happy" = "yes" -a "$enable_progress_threads" = "yes"],
77 [AC_MSG_WARN([MVAPI driver does not currently support progress threads. Disabling BTL.])
78 ompi_check_mvapi_happy="no"])
80 CPPFLAGS="$ompi_check_mvapi$1_save_CPPFLAGS"],
81 [ompi_check_mvapi_happy="no"])
83 AS_IF([test "$ompi_check_mvapi_happy" = "yes"],
85 [AS_IF([test ! -z "$with_mvapi" -a "$with_mvapi" != "no"],
86 [AC_MSG_ERROR([MVAPI support requested but not found. Aborting])])