there was an #include directive missing
[openmpi-llc.git] / config / ompi_check_mvapi.m4
blob744b0f287abae55e53cd725f9896d3d7b8a3e766
1 # -*- shell-script -*-
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
8 #                         reserved.
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.
13 # $COPYRIGHT$
14
15 # Additional copyrights may follow
16
17 # $HEADER$
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],[
27     AC_ARG_WITH([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])])
44     
45            ompi_check_mvapi$1_save_CFLAGS="$CFLAGS"
46            ompi_check_mvapi$1_save_CPPFLAGS="$CPPFLAGS"
47     
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"]) 
52     
53            # some mellanox vapi implemenations only need lvapi and lmosal    
54            OMPI_CHECK_PACKAGE([$1],
55                   [vapi.h],
56                   [vapi],
57                   [VAPI_open_hca],
58                   [-lmosal],
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],
67                         [vapi.h],
68                         [vapi],
69                         [VAPI_open_hca],
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"],
84           [$2],
85           [AS_IF([test ! -z "$with_mvapi" -a "$with_mvapi" != "no"],
86                  [AC_MSG_ERROR([MVAPI support requested but not found.  Aborting])])
87            $3])