Commits

Jeff Squyres committed 0d07642

Up to SVN r27754

Comments (0)

Files changed (467)

 ./ompi/mca/btl/Makefile.in
 ./ompi/mca/btl/mx/Makefile.in
 ./ompi/mca/btl/smcuda/Makefile.in
-./ompi/mca/btl/ofud/Makefile.in
 ./ompi/mca/btl/self/Makefile.in
 ./ompi/mca/btl/vader/Makefile.in
 ./ompi/mca/btl/tcp/Makefile.in
 ./ompi/mca/btl/openib/Makefile.in
 ./ompi/mca/btl/openib/btl_openib_lex.c
-./ompi/mca/btl/portals/Makefile.in
 ./ompi/mca/btl/udapl/*.in
 ./ompi/mca/btl/sctp/Makefile.in
 ./ompi/mca/btl/wv/Makefile.in
 ./ompi/mca/common/ofacm/Makefile.in
 ./ompi/mca/common/commpatterns/Makefile.in
 ./ompi/mca/common/netpatterns/Makefile.in
-./ompi/mca/common/portals/Makefile.in
 ./ompi/mca/common/verbs/Makefile.in
 ./ompi/mca/common/ugni/Makefile.in
 ./ompi/mca/common/cuda/Makefile.in
 ./ompi/mca/mtl/Makefile.in
 ./ompi/mca/mtl/mx/Makefile.in
 ./ompi/mca/mtl/portals4/Makefile.in
-./ompi/mca/mtl/portals/Makefile.in
 ./ompi/mca/mtl/psm/Makefile.in
 ./ompi/mca/mtl/mxm/Makefile.in
 ./ompi/mca/dpm/Makefile.in
 ./orte/mca/ras/ccp/Makefile.in
 ./orte/mca/ras/lsf/Makefile.in
 ./orte/mca/db/Makefile.in
-./orte/mca/db/dbm/Makefile.in
-./orte/mca/db/dbase/Makefile.in
+./orte/mca/db/gpdb/Makefile.in
+./orte/mca/db/pmi/Makefile.in
+./orte/mca/db/sqlite/Makefile.in
 ./orte/mca/db/hash/Makefile.in
 ./orte/mca/iof/Makefile.in
 ./orte/mca/iof/hnp/Makefile.in
 my $ompi_automake_version = "1.11.1";
 my $ompi_autoconf_version = "2.65";
 my $ompi_libtool_version = "2.2.6b";
-my $ompi_flex_version = "2.5.4";
 
 # Search paths
 my $ompi_autoconf_search = "autoconf";
 my $ompi_automake_search = "automake";
 my $ompi_libtoolize_search = "libtoolize;glibtoolize";
-my $ompi_flex_search = "flex";
 
 # One-time setup
 my $username;
     GNU Autoconf: $ompi_autoconf_version
     GNU Automake: $ompi_automake_version
     GNU Libtool: $ompi_libtool_version
-    Flex: $ompi_flex_version
 =================================================================\n";
     my_exit(1);
 }
 &find_and_check("autoconf", $ompi_autoconf_search, $ompi_autoconf_version);
 &find_and_check("libtool", $ompi_libtoolize_search, $ompi_libtool_version);
 &find_and_check("automake", $ompi_automake_search, $ompi_automake_version);
-&find_and_check("flex", $ompi_flex_search, $ompi_flex_version);
 
 #---------------------------------------------------------------------------
 
 verbose "==> Running autoreconf\n";
 chdir("..");
 my $cmd = "autoreconf -ivf --warnings=all,no-obsolete,no-override -I config";
-foreach my $project (@{$projects}) {
-    $cmd .= " -I $project->{dir}/config";
-}
 safe_system($cmd);
 
 #---------------------------------------------------------------------------

config/ompi_check_gm.m4

+# -*- shell-script -*-
+#
+# 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.
+# 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 (c) 2009      Cisco Systems, Inc.  All rights reserved.
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+
+AC_DEFUN([_OMPI_CHECK_GM_CONFIG],[
+    u_OMPI_CHECK_GM_CONFIG_SAVE_CPPFLAGS="$CPPFLAGS"
+    u_OMPI_CHECK_GM_CONFIG_SAVE_LDFLAGS="$LDFLAGS"
+    u_OMPI_CHECK_GM_CONFIG_SAVE_LIBS="$LIBS"
+
+    CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
+    LDFLAGS="$LDFLAGS $$1_LDFLAGS"
+    LIBS="$LIBS $$1_LIBS"
+
+    #
+    # See if we have GM_API_VERSION.  If we do, use it.  If not, find the
+    # highest one available.  It seems that GM_API_VERSION was introduced
+    # somewhere after 1.3 but before 1.6. :-\
+    #
+    AC_MSG_CHECKING(for GM_API_VERSION)
+    AC_TRY_COMPILE([#include<gm.h>],
+    [int foo = GM_API_VERSION;], 
+        have_gm_api_ver_msg=yes gm_api_ver=GM_API_VERSION,
+        have_gm_api_ver_msg=no  gm_api_ver="")
+    AC_MSG_RESULT([$have_gm_api_ver_msg])
+    if test "$gm_api_ver" = ""; then
+        found=0
+        for val in 5 4 3; do
+            if test "$found" = "0"; then
+                var="GM_API_VERSION_1_$val"
+                AC_MSG_CHECKING(for $var)
+                AC_TRY_COMPILE([#include<gm.h>],
+                    [int foo = $var;], 
+                    msg=yes found=1 gm_api_ver=$var,
+                    msg=no found=0 gm_api_ver="")
+                AC_MSG_RESULT($msg)
+            fi
+        done
+    fi
+    if test "$gm_api_ver" = ""; then
+        AC_MSG_WARN([*** Could not find a supported GM_API_VERSION])
+        AC_MSG_ERROR([*** Cannot continue])
+    fi
+    AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_API_VERSION], $gm_api_ver,
+        [Version of the GM API to use])
+    unset gm_api_ver have_gm_api_ver_msg found val msg
+
+    #
+    # Do we have gm_put()?
+    # gm_put() was introduced in gm 2.0, and is exactly identical to gm
+    # 1.6's gm_directed_send_with_callback().  The name was simply changed
+    # for consistency/symmtery with gm_get().
+    #
+    AC_MSG_CHECKING([for gm_put()])
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include<gm.h>
+    ]], 
+    [[gm_put(0, 0, 0, 0, 0, 0, 0, 0, 0);]])], 
+        [HAVE_RDMA_PUT=1 MSG=yes], 
+        [HAVE_RDMA_PUT=0 MSG="no, use gm_directed_send_with_callback()"])
+    AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_HAVE_RDMA_PUT], $HAVE_RDMA_PUT,
+        [Whether we have gm_put() or gm_directed_send_with_callback()])
+    AC_MSG_RESULT([$MSG])
+
+    #
+    # Do we have gm_get()?
+    # gm_get() was introduced in gm 2.0.
+    #
+    AC_MSG_CHECKING([for gm_get()])
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include<gm.h>
+    ]], 
+    [[gm_get(0, 0, 0, 0, 0, 0, 0, 0, 0);]])], 
+        [HAVE_RDMA_GET=1 MSG=yes], 
+        [HAVE_RDMA_GET=0 MSG=no])
+    AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_HAVE_RDMA_GET], $HAVE_RDMA_GET,
+        [Whether we have get_get() or not])
+    AC_MSG_RESULT([$MSG])
+
+    # Now test to see if the targetted GM is a broken one broken gm builds
+    AC_MSG_CHECKING([for broken GM 2.x RDMA gets build])
+    AC_TRY_COMPILE([
+        #include <gm.h>
+        ], [
+        #if GM_API_VERSION_2_0 &&                                 \
+           ((GM_API_VERSION_2_1_0 && GM_API_VERSION < 0x20102) || \
+             GM_API_VERSION < 0x2000c)
+          #error GM build is broken
+        #endif         ],
+       [ mca_gm_broken=0 gm_build_broken=no ],
+       [ mca_gm_broken=1 gm_build_broken=yes ]) 
+    AC_MSG_RESULT( [$gm_build_broken] )
+    AC_DEFINE_UNQUOTED( [OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_GET_BROKEN], $mca_gm_broken,
+                        [The GM build has or not a broker gm_get function] )
+    unset gm_build_broken mca_gm_broken
+
+    AC_DEFINE_UNQUOTED( [OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_SUPPORT_REGISTERING], 1,
+                        [The OS support or not the virtal page registration] )
+
+    CPPFLAGS="$u_OMPI_CHECK_GM_CONFIG_SAVE_CPPFLAGS"
+    LDFLAGS="$u_OMPI_CHECK_GM_CONFIG_SAVE_LDFLAGS"
+    LIBS="$u_OMPI_CHECK_GM_CONFIG_SAVE_LIBS"
+])dnl
+
+# OMPI_CHECK_GM(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if GM 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_GM],[
+    AC_ARG_WITH([gm],
+        [AC_HELP_STRING([--with-gm(=DIR)],
+             [Build GM (Myrinet) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
+    OMPI_CHECK_WITHDIR([gm], [$with_gm], [include/gm.h])
+    AC_ARG_WITH([gm-libdir],
+        [AC_HELP_STRING([--with-gm-libdir=DIR],
+             [Search for GM (Myrinet) libraries in DIR])])
+    OMPI_CHECK_WITHDIR([gm-libdir], [$with_gm_libdir], [libgm.*])
+
+    AS_IF([test "$with_gm" != "no"],
+          [AS_IF([test ! -z "$with_gm" -a "$with_gm" != "yes"],
+                 [ompi_check_gm_dir="$with_gm"])
+           AS_IF([test ! -z "$with_gm_libdir" -a "$with_gm_libdir" != "yes"],
+                 [ompi_check_gm_libdir="$with_gm_libdir"])
+
+           OMPI_CHECK_PACKAGE([$1],
+                              [gm.h],
+                              [gm],
+                              [gm_init],
+                              [],
+                              [$ompi_check_gm_dir],
+                              [$ompi_check_gm_libdir],
+                              [ompi_check_gm_happy="yes"],
+                              [ompi_check_gm_happy="no"])],
+          [ompi_check_gm_happy="no"])
+
+    AS_IF([test "$ompi_check_gm_happy" = "yes"],
+          [_OMPI_CHECK_GM_CONFIG($1)
+           $2],
+          [AS_IF([test ! -z "$with_gm" -a "$with_gm" != "no"],
+                 [AC_MSG_ERROR([GM support requested but not found.  Aborting])])
+           $3])
+])
+

config/ompi_check_gni.m4

+# -*- shell-script -*-
+#
+# 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.
+# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+#                         University of Stuttgart.  All rights reserved.
+# Copyright (c) 2004-2006 The Regents of the University of California.
+#                         All rights reserved.
+# Copyright (c) 2006      QLogic Corp. All rights reserved.
+# Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
+# Copyright (c) 2011      Los Alamos National Security, LLC.
+#                         All rights reserved.
+# $COPYRIGHT$
+#
+# Additional copyrights may follow
+#
+# $HEADER$
+#
+
+# OMPI_CHECK_GNI(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if GNI 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
+#
+# NOTES
+# on Cray XE6 systems, the GNI development header (gni_pub.h) is in a
+# completely different place than the ugni library (libugni).
+#
+# EXAMPLE CONFIGURE USAGE:
+# --with-gni=/base/path/to/libugni --with-gni-includedir=/path/to/gni_pub.h
+#
+# --with-gni=/opt/cray/ugni/default --with-gni-includedir=/opt/cray/gni-headers/default/include
+
+AC_DEFUN([OMPI_CHECK_GNI], [
+    AC_ARG_WITH([gni], [
+        AC_HELP_STRING([--with-gni(=DIR)],
+        [Build GNI (Cray Gemini) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
+
+    dnl does the path exist?
+    OMPI_CHECK_WITHDIR([gni], [$with_gni], [.])
+
+    AC_ARG_WITH([gni-libdir], [
+        AC_HELP_STRING([--with-gni-libdir=DIR], [
+            Search for GNI (Cray Gemini) libraries in DIR])])
+    OMPI_CHECK_WITHDIR([gni-libdir], [$with_gni_libdir], [libugni.*])
+
+    AC_ARG_WITH([gni-includedir], [
+        AC_HELP_STRING([--with-gni-includedir=DIR], [
+            Search for GNI (Cray Gemini) headers in DIR])])
+    OMPI_CHECK_WITHDIR([gni-includedir], [$with_gni_includedir], [gni_pub.h])
+
+    AS_IF([test "$with_gni_includedir" != "" -a "$with_gni_includedir" != "yes" -a "$with_gni_includedir" != "no"],
+          [$1_CPPFLAGS="$$1_CPPFLAGS -I$with_gni_includedir"])
+
+    ompi_check_gni_$1_save_CPPFLAGS="$CPPFLAGS"
+    ompi_check_gni_$1_save_LDFLAGS="$LDFLAGS"
+    ompi_check_gni_$1_save_LIBS="$LIBS"
+
+    AS_IF([test "$with_gni" != "no"], [
+        AS_IF([test ! -z "$with_gni" -a "$with_gni" != "yes"], [
+            ompi_check_gni_dir="$with_gni"])
+        AS_IF([test ! -z "$with_gni_libdir" -a "$with_gni_libdir" != "yes"], [
+            ompi_check_gni_libdir="$with_gni_libdir"])
+
+        OMPI_CHECK_PACKAGE([$1],
+            [ugni.h],
+            [ugni],
+            [GNI_CdmCreate],
+            [],
+            [$ompi_check_gni_dir],
+            [$ompi_check_gni_libdir],
+            [ompi_check_gni_happy="yes"],
+            [ompi_check_gni_happy="no"])],
+          [ompi_check_gni_happy="no"])
+
+    CPPFLAGS="$ompi_check_gni_$1_save_CPPFLAGS"
+    LDFLAGS="$ompi_check_gni_$1_save_LDFLAGS"
+    LIBS="$ompi_check_gni_$1_save_LIBS"
+
+    dnl XXX not sure if this is true, but will assume so...
+    AS_IF([test "$ompi_check_gni_happy" = "yes" -a "$enable_progress_threads" = "yes"],
+          [AC_MSG_WARN([GNI driver does not currently support progress threads.  Disabling.])
+           ompi_check_gni_happy="no"])
+
+    AS_IF([test "$ompi_check_gni_happy" = "yes"],
+          [$2],
+          [AS_IF([test ! -z "$with_gni" -a "$with_gni" != "no"],
+                 [AC_MSG_ERROR([GNI support requested but not found.  Cannot continue.])])
+           $3])
+])
+

config/ompi_check_libfca.m4

+# -*- shell-script -*-
+#
+# Copyright (c) 2011 Mellanox Technologies. All rights reserved.
+
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+# OMPI_CHECK_FCA(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if fca 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_FCA],[
+    AC_ARG_WITH([fca],
+        [AC_HELP_STRING([--with-fca(=DIR)],
+             [Build fca (Mellanox Fabric Collective Accelerator) support, searching for libraries in DIR])])
+    OMPI_CHECK_WITHDIR([fca], [$with_fca], [lib/libfca.so])
+
+    AS_IF([test "$with_fca" != "no"],
+          [AS_IF([test ! -z "$with_fca" -a "$with_fca" != "yes"],
+			  [ompi_check_fca_dir=$with_fca
+			   ompi_check_fca_libdir="$ompi_check_fca_dir/lib"
+			   ompi_check_fca_incdir="$ompi_check_fca_dir/include"
+			   ompi_check_fca_libs=fca
+
+			   CPPFLAGS_save=$CPPFLAGS
+			   LDFLAGS_save=$LDFLAGS
+			   LIBS_save=$LIBS
+			   CPPFLAGS="$CPPFLAGS -I$ompi_check_fca_dir/include/fca -I$ompi_check_fca_dir/include/fca_core"
+
+			   OPAL_LOG_MSG([$1_CPPFLAGS : $$1_CPPFLAGS], 1)
+			   OPAL_LOG_MSG([$1_LDFLAGS  : $$1_LDFLAGS], 1)
+			   OPAL_LOG_MSG([$1_LIBS     : $$1_LIBS], 1)
+
+			   OMPI_CHECK_PACKAGE([$1],
+				   [fca_api.h],
+				   [$ompi_check_fca_libs],
+				   [fca_get_version],
+				   [-l$ompi_check_fca_libs],
+				   [$ompi_check_fca_dir],
+				   [$ompi_check_fca_libdir],
+				   [ompi_check_fca_happy="yes"],
+				   [ompi_check_fca_happy="no"])
+
+			   CPPFLAGS=$CPPFLAGS_save
+			   LDFLAGS=$LDFLAGS_save
+			   LIBS=$LIBS_save],
+			   [ompi_check_fca_happy="no"])
+          ])
+
+    AS_IF([test "$ompi_check_fca_happy" = "yes" -a "$enable_progress_threads" = "yes"],
+          [AC_MSG_WARN([fca driver does not currently support progress threads.  Disabling FCA.])
+           ompi_check_fca_happy="no"])
+
+    AS_IF([test "$ompi_check_fca_happy" = "yes"],
+          [$2],
+          [AS_IF([test ! -z "$with_fca" -a "$with_fca" != "no"],
+                 [AC_MSG_ERROR([FCA support requested but not found.  Aborting])])
+           $3])
+])
+

config/ompi_check_lustre.m4

+# -*- shell-script -*-
+#
+# 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.
+# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+# Copyright (c) 2004-2006 The Regents of the University of California.
+#                         All rights reserved.
+# Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
+# Copyright (c) 2008-2012 University of Houston. All rights reserved.
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+# OMPI_CHECK_LUSTRE(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if LUSTRE 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_LUSTRE],[
+
+    check_lustre_CPPFLAGS=
+    check_lustre_LDFLAGS=
+    check_lustre_LIBS=
+
+    check_lustre_save_LIBS="$LIBS" 
+    check_lustre_save_LDFLAGS="$LDFLAGS"
+    check_lustre_save_CPPFLAGS="$CPPFLAGS"
+
+    check_lustre_configuration="none"
+    ompi_check_lustre_happy="yes"
+
+
+    # Get some configuration information
+    AC_ARG_WITH([lustre],
+        [AC_HELP_STRING([--with-lustre(=DIR)],
+             [Build Lustre support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
+    OMPI_CHECK_WITHDIR([lustre], [$with_lustre], [include/lustre/liblustreapi.h])
+
+    AC_ARG_WITH([lustre-libs], 
+        [AC_HELP_STRING([--with-lustre-libs=LIBS],
+                       [Libraries to link with for lustre])])
+
+    temp_with_lustre="$with_lustre"
+    AS_IF([test -z "$with_lustre"],
+          [with_lustre="/usr/"])
+
+    temp_with_lustre_libs="$with_lustre_libs"
+    AS_IF([test -z "$with_lustre_libs"],
+	[with_lustre_libs="lustre lustreapi"])
+    
+    # Add correct -I and -L flags
+    AS_IF([test -d "$with_lustre/include/lustre/"],
+        [check_lustre_CPPFLAGS="-I$with_lustre/include/lustre/"
+            $1_CPPFLAGS="$check_lustre_CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $check_lustre_CPPFLAGS"], 
+	[ompi_check_lustre_happy="no"])
+    
+    AS_IF([test "$ompi_check_lustre_happy" = "yes"],
+	[AS_IF([test -d "$with_lustre/lib64"],
+		[check_lustre_LDFLAGS="-L$with_lustre/lib64"
+		    $1_LDFLAGS="$check_lustre_LDFLAGS"
+		    LDFLAGS="$LDFLAGS $check_lustre_LDFLAGS"],
+		[ompi_check_lustre_happy="no"]) 
+    ],[])
+	    
+    # Try to find all the lustre libraries
+    AS_IF([test "$ompi_check_lustre_happy" = "yes"],
+	[ AS_IF([test -n "$with_lustre_libs"]
+		[for lib in $with_lustre_libs ; do
+		    check_lustre_LIBS="$check_lustre_LIBS -l$lib"
+		    done]) 
+		
+	    $1_LIBS="$check_lustre_LIBS"
+	    LIBS="$LIBS $check_lustre_LIBS"
+
+            # check for lustre
+	    AC_CHECK_HEADERS([liblustreapi.h],
+		[AC_MSG_CHECKING([if possible to link LUSTRE])
+		    AC_LINK_IFELSE([AC_LANG_PROGRAM(
+				[[#include <stdio.h>
+                                  #include <liblustreapi.h>]], 
+				[[llapi_file_create(NULL,0,-1,0, 0);]])],
+			[AC_MSG_RESULT([yes])
+			    ompi_check_lustre_happy="yes"],
+			[AC_MSG_RESULT([no])
+			    ompi_check_lustre_happy="no"])],
+		[ompi_check_lustre_happy="no"])
+    ])
+
+    LDFLAGS="$check_lustre_save_LDFLAGS"
+    CPPFLAGS="$check_lustre_save_CPPFLAGS"
+    LIBS="$check_lustre_save_LIBS"
+
+    AS_IF([test "$ompi_check_lustre_happy" = "yes"],
+          [$2],
+          [AS_IF([test ! -z "$with_lustre" -a "$with_lustre" != "no"],
+                  [echo LUSTRE support not found])
+              $3])
+
+    with_lustre="$temp_with_lustre"
+    with_lustre_libs="$temp_with_lustre_libs"
+])

config/ompi_check_mx.m4

+# -*- shell-script -*-
+#
+# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+#                         University Research and Technology
+#                         Corporation.  All rights reserved.
+# Copyright (c) 2004-2007 The University of Tennessee and The University
+#                         of Tennessee Research Foundation.  All rights
+#                         reserved.
+# 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 (c) 2009      Cisco Systems, Inc.  All rights reserved.
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+# _OMPI_CHECK_MX_MAPPER()
+# ------------------------
+# Check if the MX library provide the necessary functions in order to
+# figure out the mapper version and MAC for each board.
+AC_DEFUN([_OMPI_CHECK_MX_MAPPER],[
+    AC_CACHE_CHECK([for mx_open_board],
+        [ompi_cv_func_mx_open_board],
+        [AC_LINK_IFELSE([AC_LANG_PROGRAM(
+                [
+#include <mx_extensions.h>
+#include <mx_io.h>
+#include <mx_internals/mx__fops.h>
+                ], [
+mx_open_board(0, NULL);
+                ])],
+            [ompi_cv_func_mx_open_board="yes"],
+            [ompi_cv_func_mx_open_board="no"])])
+
+    AC_CACHE_CHECK([for mx__get_mapper_state],
+        [ompi_cv_func_mx__get_mapper_state],
+        [AC_LINK_IFELSE([AC_LANG_PROGRAM(
+                [
+#include <mx_extensions.h>
+#include <mx_io.h>
+#include <mx_internals/mx__driver_interface.h>
+                ], [
+mx__get_mapper_state(NULL, NULL);
+                ])],
+             [ompi_cv_func_mx__get_mapper_state="yes"],
+             [ompi_cv_func_mx__get_mapper_state="no"])])
+
+    AS_IF([test "$ompi_cv_func_mx_open_board" = "yes" -a "$ompi_cv_func_mx__get_mapper_state" = "yes"],
+          [mx_provide_mapper_state=1
+           $2],
+          [mx_provide_mapper_state=0
+           $3])
+    AC_DEFINE_UNQUOTED([MX_HAVE_MAPPER_STATE], [$mx_provide_mapper_state],
+                       [MX installation provide access to the mx_open_board and mx__get_mapper_state functions])
+])
+
+
+# OMPI_CHECK_MX(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if MX 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_MX],[
+    AC_ARG_WITH([mx],
+        [AC_HELP_STRING([--with-mx(=DIR)],
+             [Build MX (Myrinet Express) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
+    OMPI_CHECK_WITHDIR([mx], [$with_mx], [include/myriexpress.h])
+    AC_ARG_WITH([mx-libdir],
+        [AC_HELP_STRING([--with-mx-libdir=DIR],
+             [Search for MX (Myrinet Express) libraries in DIR])])
+    OMPI_CHECK_WITHDIR([mx-libdir], [$with_mx_libdir], [libmyriexpress.*])
+
+    ompi_check_mx_$1_save_CPPFLAGS="$CPPFLAGS"
+    ompi_check_mx_$1_save_LDFLAGS="$LDFLAGS"
+    ompi_check_mx_$1_save_LIBS="$LIBS"
+
+    AS_IF([test "$with_mx" != "no"],
+          [AS_IF([test ! -z "$with_mx" -a "$with_mx" != "yes"],
+                 [ompi_check_mx_dir="$with_mx"])
+           AS_IF([test ! -z "$with_mx_libdir" -a "$with_mx_libdir" != "yes"],
+                 [ompi_check_mx_libdir="$with_mx_libdir"])
+
+           OMPI_CHECK_PACKAGE([$1],
+                              [myriexpress.h],
+                              [myriexpress],
+                              [mx_finalize],
+                              [],
+                              [$ompi_check_mx_dir],
+                              [$ompi_check_mx_libdir],
+                              [ompi_check_mx_happy="yes"],
+                              [ompi_check_mx_happy="no"])],
+          [ompi_check_mx_happy="no"])
+
+    CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
+    LDFLAGS="$LDFLAGS $$1_LDFLAGS"
+    LIBS="$LIBS $$1_LIBS"
+
+    # need at least version 1.0
+    AS_IF([test "ompi_check_mx_happy" = "yes"],
+          [AC_CACHE_CHECK([for MX version 1.0 or later],
+            [ompi_cv_mx_version_ok],
+            [AC_PREPROC_IFELSE(
+                [AC_LANG_PROGRAM([
+#include <myriexpress.h>
+                             ],[
+#if MX_API < 0x300
+#error "Version less than 0x300"
+#endif
+                             ])],
+            [ompi_cv_mx_version_ok="yes"],
+            [ompi_cv_mx_version_ok="no"])])])
+    AS_IF([test "$ompi_cv_mx_version_ok" = "no"], [ompi_check_mx_happy="no"])
+
+    AS_IF([test "$ompi_check_mx_happy" = "yes"],
+          [AC_CHECK_HEADERS([mx_extensions.h],
+               [AC_CHECK_FUNCS([mx_forget mx_register_unexp_handler])
+                _OMPI_CHECK_MX_MAPPER()],
+               [AC_MSG_WARN([The MX support for Open MPI will be compiled without the
+MX extensions, which may result in lower performance.  Please upgrade
+to at least MX 1.2.0 to enable the MX extensions.])])])
+
+    CPPFLAGS="$ompi_check_mx_$1_save_CPPFLAGS"
+    LDFLAGS="$ompi_check_mx_$1_save_LDFLAGS"
+    LIBS="$ompi_check_mx_$1_save_LIBS"
+
+    AS_IF([test "$ompi_check_mx_happy" = "yes" -a "$enable_progress_threads" = "yes"],
+          [AC_MSG_WARN([MX driver does not currently support progress threads.  Disabling BTL.])
+           ompi_check_mx_happy="no"])
+
+    AS_IF([test "$ompi_check_mx_happy" = "yes"],
+          [$2],
+          [AS_IF([test ! -z "$with_mx" -a "$with_mx" != "no"],
+                 [AC_MSG_ERROR([MX support requested but not found.  Aborting])])
+           $3])
+])
+

config/ompi_check_mxm.m4

+# -*- shell-script -*-
+#
+# Copyright (C) Mellanox Technologies Ltd. 2001-2011.  ALL RIGHTS RESERVED.
+# $COPYRIGHT$
+#
+# Additional copyrights may follow
+#
+# $HEADER$
+#
+
+# OMPI_CHECK_MXM(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if MXM 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_MXM],[
+    AC_ARG_WITH([mxm],
+        [AC_HELP_STRING([--with-mxm(=DIR)],
+             [Build Mellanox Messaging support])])
+    OMPI_CHECK_WITHDIR([mxm], [$with_mxm], [include/mxm/api/mxm_api.h])
+    AC_ARG_WITH([mxm-libdir],
+        [AC_HELP_STRING([--with-mxm-libdir=DIR],
+             [Search for Mellanox Messaging libraries in DIR])])
+    OMPI_CHECK_WITHDIR([mxm-libdir], [$with_mxm_libdir], [libmxm.*])
+
+    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"],
+          [AS_IF([test ! -z "$with_mxm" -a "$with_mxm" != "yes"],
+                 [ompi_check_mxm_dir="$with_mxm"])
+           AS_IF([test ! -z "$with_mxm_libdir" -a "$with_mxm_libdir" != "yes"],
+                 [ompi_check_mxm_libdir="$with_mxm_libdir"])
+
+           OMPI_CHECK_PACKAGE([$1],
+                              [mxm/api/mxm_api.h],
+                              [mxm],
+                              [mxm_cleanup],
+			      [],
+                              [$ompi_check_mxm_dir],
+                              [$ompi_check_mxm_libdir],
+                              [ompi_check_mxm_happy="yes"],
+                              [ompi_check_mxm_happy="no"])],
+          [ompi_check_mxm_happy="no"])
+
+    CPPFLAGS="$ompi_check_mxm_$1_save_CPPFLAGS"
+    LDFLAGS="$ompi_check_mxm_$1_save_LDFLAGS"
+    LIBS="$ompi_check_mxm_$1_save_LIBS"
+
+    AS_IF([test "$ompi_check_mxm_happy" = "yes"],
+          [$2],
+          [AS_IF([test ! -z "$with_mxm" -a "$with_mxm" != "no"],
+                 [AC_MSG_ERROR([MXM support requested but not found.  Aborting])])
+           $3])
+])
+

config/ompi_check_openfabrics.m4

+# -*- shell-script -*-
+#
+# 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.
+# 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 (c) 2006-2012 Cisco Systems, Inc.  All rights reserved.
+# Copyright (c) 2006-2011 Los Alamos National Security, LLC.  All rights
+#                         reserved.
+# Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved.
+# Copyright (c) 2010-2012 Oracle and/or its affiliates.  All rights reserved.
+# Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+
+# OMPI_CHECK_OPENFABRICS(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if OPENIB 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_OPENFABRICS],[
+    OPAL_VAR_SCOPE_PUSH([$1_msg])
+
+    # Setup the --with switches to allow users to specify where
+    # verbs stuff lives.
+    AC_REQUIRE([OPAL_CHECK_VERBS_DIR])
+
+    #
+    # Add padding to OpenIB header
+    #
+    AC_ARG_ENABLE([openib-control-hdr-padding],
+        [AC_HELP_STRING([--enable-openib-control-hdr-padding],
+            [Add padding bytes to the openib BTL control header (default:disabled)])])
+    AC_MSG_CHECKING([if want to add padding to the openib BTL control header])
+    if test "$enable_openib_control_hdr_padding" = "yes"; then
+        AC_MSG_RESULT([yes])
+        ompi_openib_pad_hdr=1
+    elif test "$enable_openib_control_hdr_padding" = "no"; then
+        AC_MSG_RESULT([no])
+        ompi_openib_pad_hdr=0
+    else
+        #
+        # Enable padding for SPARC platforms by default  because the
+        # btl will segv otherwise.  Keep padding disabled for other 
+        # platforms since there are some performance implications with
+        #  padding on for those plaforms.
+        #
+        case "${host}" in
+        sparc*)
+            AC_MSG_RESULT([yes (enabled by default on SPARC)])
+            ompi_openib_pad_hdr=1
+            ;;
+        *)
+            AC_MSG_RESULT([no])
+            ompi_openib_pad_hdr=0
+            ;;
+        esac
+    fi
+    AC_DEFINE_UNQUOTED([OMPI_OPENIB_PAD_HDR], [$ompi_openib_pad_hdr],
+                       [Add padding bytes to the openib BTL control header])
+
+    AS_IF([test "$opal_want_verbs" = "no"],
+          [ompi_check_openib_happy="no"],
+          [ompi_check_openib_happy="yes"])
+
+    ompi_check_openib_$1_save_CPPFLAGS="$CPPFLAGS"
+    ompi_check_openib_$1_save_LDFLAGS="$LDFLAGS"
+    ompi_check_openib_$1_save_LIBS="$LIBS"
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"],
+          [AS_IF([test "$THREAD_TYPE" != "posix" -a "$memory_ptmalloc2_happy" = "yes"],
+                 [AS_IF([test "$enable_ptmalloc2_internal" = "yes"],
+                        [AC_MSG_WARN([POSIX threads are disabled, but])
+                         AC_MSG_WARN([--enable-ptmalloc2-internal was specified.  This will])
+                         AC_MSG_WARN([cause memory corruption with OpenFabrics.])
+                         AC_MSG_WARN([Not building component.])
+                         ompi_check_openib_happy="no"],
+                        [AC_MSG_WARN([POSIX threads are disabled, but the ptmalloc2 memory])
+                         AC_MSG_WARN([manager is being built.  Compiling MPI applications with])
+                         AC_MSG_WARN([-lopenmpi-malloc will result in memory corruption; Open])
+                         AC_MSG_WARN([MPI will disable the openib BTL at run-time if such a])
+                         AC_MSG_WARN([combination is detected.])
+                         AC_MSG_WARN([You have been warned.])])])])
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"], 
+            [AC_CHECK_HEADERS(
+                fcntl.h sys/poll.h,
+                    [],
+                    [AC_MSG_WARN([fcntl.h sys/poll.h not found.  Can not build component.])
+                    ompi_check_openib_happy="no"])]) 
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"], 
+          [OMPI_CHECK_PACKAGE([$1],
+                              [infiniband/verbs.h],
+                              [ibverbs],
+                              [ibv_open_device],
+                              [],
+                              [$opal_verbs_dir],
+                              [$opal_verbs_libdir],
+                              [ompi_check_openib_happy="yes"],
+                              [ompi_check_openib_happy="no"])])
+
+    CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
+    LDFLAGS="$LDFLAGS $$1_LDFLAGS"
+    LIBS="$LIBS $$1_LIBS"
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"],
+          [AC_CACHE_CHECK(
+              [number of arguments to ibv_create_cq],
+              [ompi_cv_func_ibv_create_cq_args],
+              [AC_LINK_IFELSE(
+                 [AC_LANG_PROGRAM(
+                    [[#include <infiniband/verbs.h> ]],
+                    [[ibv_create_cq(NULL, 0, NULL, NULL, 0);]])],
+                 [ompi_cv_func_ibv_create_cq_args=5],
+                 [AC_LINK_IFELSE(
+                    [AC_LANG_PROGRAM(
+                       [[#include <infiniband/verbs.h> ]],
+                       [[ibv_create_cq(NULL, 0, NULL);]])],
+                    [ompi_cv_func_ibv_create_cq_args=3],
+                    [ompi_cv_func_ibv_create_cq_args="unknown"])])])
+           AS_IF([test "$ompi_cv_func_ibv_create_cq_args" = "unknown"],
+                 [AC_MSG_WARN([Can not determine number of args to ibv_create_cq.])
+                  AC_MSG_WARN([Not building component.])
+                  ompi_check_openib_happy="no"],
+                 [AC_DEFINE_UNQUOTED([OMPI_IBV_CREATE_CQ_ARGS],
+                                     [$ompi_cv_func_ibv_create_cq_args],
+                                     [Number of arguments to ibv_create_cq])])])
+
+    #
+    # OpenIB dynamic SL
+    #
+    AC_ARG_ENABLE([openib-dynamic-sl],
+        [AC_HELP_STRING([--enable-openib-dynamic-sl],
+                        [Enable openib BTL to query Subnet Manager for IB SL (default: enabled)])])
+
+    # Set these up so that we can do an AC_DEFINE below
+    # (unconditionally)
+    $1_have_xrc=0
+    $1_have_opensm_devel=0
+
+    # If we have the openib stuff available, find out what we've got
+    AS_IF([test "$ompi_check_openib_happy" = "yes"],
+          [AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER, IBV_ACCESS_SO], [], [],
+                          [#include <infiniband/verbs.h>])
+           AC_CHECK_FUNCS([ibv_get_device_list ibv_resize_cq])
+
+           # struct ibv_device.transport_type was added in OFED v1.2
+           AC_CHECK_MEMBERS([struct ibv_device.transport_type], [], [],
+                            [#include <infiniband/verbs.h>])
+
+           # ibv_create_xrc_rcv_qp was added in OFED 1.3
+           if test "$enable_connectx_xrc" = "yes"; then
+               AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp], [$1_have_xrc=1])
+           fi
+
+           if test "no" != "$enable_openib_dynamic_sl"; then
+               # We need ib_types.h file, which is installed with opensm-devel
+               # package. However, ib_types.h has a bad include directive,
+               # which will cause AC_CHECK_HEADER to fail.
+               # So instead, we will look for another file that is also
+               # installed as part of opensm-devel package and included in
+               # ib_types.h, but it doesn't include any other IB-related files.
+               AC_CHECK_HEADER([infiniband/complib/cl_types_osd.h],
+                               [AC_CHECK_LIB([osmcomp], [cl_map_init],
+                                             [$1_have_opensm_devel=1],[])],
+                               [],
+                               [])
+               # Abort if dynamic SL support was explicitly requested but opensm-devel
+               # package wasn't found. Otherwise, OMPI will be built w/o dynamic SL.
+               AC_MSG_CHECKING([if can use dynamic SL support])
+               AS_IF([test "$$1_have_opensm_devel" = "1"],
+                     [AC_MSG_RESULT([yes])],
+                     [AC_MSG_RESULT([no])
+                      AS_IF([test "$enable_openib_dynamic_sl" = "yes"],
+                            [AC_MSG_WARN([--enable-openib-dynamic-sl was specified but the])
+                             AC_MSG_WARN([appropriate header/library files could not be found])
+                             AC_MSG_WARN([Please install opensm-devel if you need dynamic SL support])
+                             AC_MSG_ERROR([Cannot continue])])])
+           fi
+
+
+           # Check support for RDMAoE devices
+           $1_have_rdmaoe=0
+           AC_CHECK_DECLS([IBV_LINK_LAYER_ETHERNET],
+                          [$1_have_rdmaoe=1], [],
+                          [#include <infiniband/verbs.h>])
+
+           AC_MSG_CHECKING([if RDMAoE support is enabled])
+           AC_DEFINE_UNQUOTED([OMPI_HAVE_RDMAOE], [$$1_have_rdmaoe], [Enable RDMAoE support])
+           if test "1" = "$$1_have_rdmaoe"; then
+                AC_MSG_RESULT([yes])
+           else
+                AC_MSG_RESULT([no])
+           fi
+
+          ])
+
+    # Check to see if <infiniband/driver.h> works.  It is known to
+    # create problems on some platforms with some compilers (e.g.,
+    # RHEL4U3 with the PGI 32 bit compiler).  Use undocumented (in AC
+    # 2.63) feature of AC_CHECK_HEADERS: if you explicitly pass in
+    # AC_INCLUDES_DEFAULT as the 4th arg to AC_CHECK_HEADERS, the test
+    # will fail if the header is present but not compilable, *but it
+    # will not print the big scary warning*.  See
+    # http://lists.gnu.org/archive/html/autoconf/2008-10/msg00143.html.
+    AS_IF([test "$ompi_check_openib_happy" = "yes"],
+          [AC_CHECK_HEADERS([infiniband/driver.h], [], [], 
+                            [AC_INCLUDES_DEFAULT])])
+
+    AC_MSG_CHECKING([if ConnectX XRC support is enabled])
+    AC_DEFINE_UNQUOTED([OMPI_HAVE_CONNECTX_XRC], [$$1_have_xrc],
+        [Enable features required for ConnectX XRC support])
+    if test "1" = "$$1_have_xrc"; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_RESULT([no])
+    fi
+
+    AC_MSG_CHECKING([if dynamic SL is enabled])
+    AC_DEFINE_UNQUOTED([OMPI_ENABLE_DYNAMIC_SL], [$$1_have_opensm_devel],
+        [Enable features required for dynamic SL support])
+    if test "1" = "$$1_have_opensm_devel"; then
+        AC_MSG_RESULT([yes])
+        $1_LIBS="-losmcomp $$1_LIBS"
+    else
+        AC_MSG_RESULT([no])
+    fi
+
+    AS_IF([test -z "$opal_verbs_dir"],
+          [openib_include_dir="/usr/include"],
+          [openib_include_dir="$opal_verbs_dir/include"])
+    $1_CPPFLAGS="$$1_CPPFLAGS -I$openib_include_dir/infiniband"
+
+    CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS"
+    LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS"
+    LIBS="$ompi_check_openib_$1_save_LIBS"
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"],
+          [$2],
+          [AS_IF([test "$opal_want_verbs" = "yes"],
+                 [AC_MSG_WARN([Verbs support requested (via --with-verbs) but not found.])
+                  AC_MSG_WARN([If you are using libibverbs v1.0 (i.e., OFED v1.0 or v1.1), you *MUST* have both the libsysfs headers and libraries installed.  Later versions of libibverbs do not require libsysfs.])
+                  AC_MSG_ERROR([Aborting.])])
+           $3])
+
+     OPAL_VAR_SCOPE_POP
+])
+
+AC_DEFUN([OMPI_CHECK_OPENFABRICS_CM_ARGS],[
+    #
+    # ConnectX XRC support
+    #
+    AC_ARG_ENABLE([openib-connectx-xrc],
+        [AC_HELP_STRING([--enable-openib-connectx-xrc],
+                        [Enable ConnectX XRC support in the openib BTL. If you do not have InfiniBand ConnectX adapters, you may disable the ConnectX XRC support. If you do not know which InfiniBand adapter is installed on your cluster, leave this option enabled (default: enabled)])],
+                        [enable_connectx_xrc="$enableval"], [enable_connectx_xrc="yes"])
+    #
+    # Unconnect Datagram (UD) based connection manager
+    #
+#    AC_ARG_ENABLE([openib-udcm],
+#        [AC_HELP_STRING([--enable-openib-udcm],
+#                        [Enable datagram connection support in openib BTL (default: enabled)])], 
+#                        [enable_openib_udcm="$enableval"], [enable_openib_udcm="yes"])
+    # Per discussion with Ralph and Nathan, disable UDCM for now.
+    # It's borked and needs some surgery to get back on its feet.
+    enable_openib_udcm=no
+
+    #
+    # Openfabrics RDMACM
+    #
+    AC_ARG_ENABLE([openib-rdmacm],
+        [AC_HELP_STRING([--enable-openib-rdmacm],
+                        [Enable Open Fabrics RDMACM support in openib BTL (default: enabled)])])
+])dnl
+
+AC_DEFUN([OMPI_CHECK_OPENFABRICS_CM],[
+    AC_REQUIRE([OMPI_CHECK_OPENFABRICS_CM_ARGS])
+    $1_have_udcm=0
+    $1_have_rdmacm=0
+
+    ompi_check_openib_$1_save_CPPFLAGS="$CPPFLAGS"
+    ompi_check_openib_$1_save_LDFLAGS="$LDFLAGS"
+    ompi_check_openib_$1_save_LIBS="$LIBS"
+
+    # add back in all the InfiniBand flags so that these tests might work...
+    CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
+    LDFLAGS="$LDFLAGS $$1_LDFLAGS"
+    LIBS="$LIBS $$1_LIBS"
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"],
+          [# Do we have a recent enough RDMA CM?  Need to have the
+           # rdma_get_peer_addr (inline) function (originally appeared
+           # in OFED v1.3).
+           if test "$enable_openib_rdmacm" != "no"; then
+                 AC_CHECK_HEADERS([rdma/rdma_cma.h],
+                     [AC_CHECK_LIB([rdmacm], [rdma_create_id],
+                         [AC_MSG_CHECKING([for rdma_get_peer_addr])
+                         $1_msg=no
+                         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "rdma/rdma_cma.h"
+                                 ]], [[void *ret = (void*) rdma_get_peer_addr((struct rdma_cm_id*)0);]])],
+                             [$1_have_rdmacm=1 
+                             $1_msg=yes])
+                         AC_MSG_RESULT([$$1_msg])])])
+
+                 if test "1" = "$$1_have_rdmacm"; then
+                     $1_LIBS="-lrdmacm $$1_LIBS"
+                 else
+                     AS_IF([test "$enable_openib_rdmacm" = "yes"],
+                           [AC_MSG_WARN([--enable-openib-rdmacm was specified but the])
+                            AC_MSG_WARN([appropriate files could not be found])
+                            AC_MSG_WARN([Please install librdmacm and librdmacm-devel or disable rdmacm support])
+                            AC_MSG_ERROR([Cannot continue])])
+                 fi
+           fi
+
+           # is udcm enabled
+           if test "$enable_openib_udcm" = "yes"; then
+               $1_have_udcm=1
+           fi
+           ])
+
+    CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS"
+    LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS"
+    LIBS="$ompi_check_openib_$1_save_LIBS"
+
+    AC_MSG_CHECKING([if UD CM is enabled])
+    AC_DEFINE_UNQUOTED([OMPI_HAVE_UDCM], [$$1_have_udcm],
+        [Whether UD CM is available or not])
+    if test "1" = "$$1_have_udcm"; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_RESULT([no])
+    fi
+
+    AC_MSG_CHECKING([if OpenFabrics RDMACM support is enabled])
+    AC_DEFINE_UNQUOTED([OMPI_HAVE_RDMACM], [$$1_have_rdmacm],
+        [Whether RDMA CM is available or not])
+    if test "1" = "$$1_have_rdmacm"; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_RESULT([no])
+    fi
+])dnl
+
+AC_DEFUN([OMPI_CHECK_MLNX_OPENFABRICS],[
+     $1_have_mverbs=0
+     $1_have_mqe=0
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"], 
+           [OMPI_CHECK_PACKAGE([$1],
+                               [infiniband/mverbs.h],
+                               [mverbs],
+                               [ibv_m_query_device],
+                               ["$$1_LIBS"],
+                               [$opal_verbs_dir],
+                               [$opal_verbs_libdir],
+                               [$1_have_mverbs=1],
+                               [])])
+
+    AS_IF([test "$ompi_check_openib_happy" = "yes"], 
+           [OMPI_CHECK_PACKAGE([$1],
+                               [infiniband/mqe.h],
+                               [mqe],
+                               [mqe_context_create],
+                               ["$$1_LIBS"],
+                               [$opal_verbs_dir],
+                               [$opal_verbs_libdir],
+                               [$1_have_mqe=1],
+                               [])])
+
+    AC_MSG_CHECKING([if Mellanox OpenFabrics VERBS is enabled])
+    AC_DEFINE_UNQUOTED([OMPI_HAVE_MVERBS], [$$1_have_mverbs],
+        [Whether MVERBS is available or not])
+    AS_IF([test "1" = "$$1_have_mverbs"],
+          [AC_MSG_RESULT([yes])],
+          [AC_MSG_RESULT([no])])
+
+    # save the CPPFLAGS since we would have to update it for next test
+    ompi_check_mellanox_openfabrics_$1_save_CPPFLAGS="$CPPFLAGS"
+
+    # If openfabrics custom directory have been defined, we have
+    # to use it for MACRO test that uses mverbs.h file.
+    #
+    if test ! -z "$ompi_check_verbs_dir" ; then
+        CPPFLAGS="-I${opal_verbs_dir}/include $CPPFLAGS"
+    fi
+
+    AS_IF([test "1" = "$$1_have_mverbs"],
+          [AC_CHECK_DECLS([IBV_M_WR_CALC_RDMA_WRITE_WITH_IMM], 
+                          [AC_DEFINE_UNQUOTED([OMPI_HAVE_IBOFFLOAD_CALC_RDMA], [1],
+                                              [Whether IBV_M_WR_CALC_SEND is defined or not])], 
+                          [AC_DEFINE_UNQUOTED([OMPI_HAVE_IBOFFLOAD_CALC_RDMA], [0],
+                                              [Whether IBV_M_WR_CALC_SEND is defined or not])], 
+                          [#include <infiniband/mverbs.h>])])
+
+    # restoring the CPPFLAGS
+    CPPFLAGS="$ompi_check_mellanox_openfabrics_$1_save_CPPFLAGS"
+
+    AC_MSG_CHECKING([if Mellanox OpenFabrics MQE is enabled])
+    AC_DEFINE_UNQUOTED([OMPI_HAVE_MQE], [$$1_have_mqe],
+        [Whether MQE is available or not])
+    AS_IF([test "1" = "$$1_have_mqe"],
+          [AC_MSG_RESULT([yes])],
+          [AC_MSG_RESULT([no])])
+
+    AS_IF([test "1" = "$$1_have_mverbs" -a "1" = $$1_have_mqe],
+            [$2], [$3])
+])dnl

config/ompi_check_portals.m4

+# -*- shell-script -*-
+#
+# 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.
+# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+# Copyright (c) 2004-2006 The Regents of the University of California.
+#                         All rights reserved.
+# Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+# OMPI_CHECK_PORTALS(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if PORTALS 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_PORTALS],[
+    # save compiler flags so that we don't alter them for later
+    # components.
+    check_portals_save_CPPFLAGS="$CPPFLAGS"
+    check_portals_save_LDFLAGS="$LDFLAGS"
+    check_portals_save_LIBS="$LIBS"
+
+    check_portals_CPPFLAGS=
+    check_portals_LDFLAGS=
+    check_portals_LIBS=
+
+    check_portals_configuration="none"
+    ompi_check_portals_happy="yes"
+
+    # Get some configuration information
+    AC_ARG_WITH([portals],
+        [AC_HELP_STRING([--with-portals(=DIR)],
+             [Build Portals support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
+    OMPI_CHECK_WITHDIR([portals], [$with_portals], [include/portals3.h])
+    AC_ARG_WITH([portals-config],
+            AC_HELP_STRING([--with-portals-config],
+                           [configuration to use for Portals support.
+                            One of "utcp", "xt3", "xt3-modex".  (default: utcp)]))
+    AC_ARG_WITH([portals-libs], 
+        [AC_HELP_STRING([--with-portals-libs=LIBS],
+                       [Libraries to link with for portals])])
+
+    AC_MSG_CHECKING([for Portals configuration])
+    if test "$with_portals_config" = "" ; then
+        with_portals_config="utcp"
+    elif test "$with_portals_config" = "redstorm" ; then
+        with_portals_config="xt3"
+    elif test "$with_portals_config" = "cnl_modex" ; then
+	with_portals_config="xt3-modex"
+    fi
+    OMPI_PORTALS_UTCP=0
+    OMPI_PORTALS_CRAYXT3=0
+    OMPI_PORTALS_CRAYXT3_MODEX=0
+    case "$with_portals_config" in
+        "utcp")
+            OMPI_PORTALS_UTCP=1
+            OMPI_PORTALS_HAVE_EVENT_UNLINK=1
+            check_portals_LIBS="-lp3utcp -lp3api -lp3lib -lp3rt -lp3utcp"
+            check_portals_header_prefix=
+            AC_MSG_RESULT([utcp])
+            ;;
+        "xt3")
+            OMPI_PORTALS_CRAYXT3=1
+            OMPI_PORTALS_HAVE_EVENT_UNLINK=0
+            check_portals_LIBS=
+            check_portals_header_prefix="portals/"
+            AC_MSG_RESULT([Cray XT3])
+            ;;
+        "xt3-modex")
+            OMPI_PORTALS_CRAYXT3_MODEX=1
+            OMPI_PORTALS_HAVE_EVENT_UNLINK=0
+            check_portals_LIBS=
+            check_portals_header_prefix="portals/"
+            AC_MSG_RESULT([Cray XT3 - Modex])
+            ;;
+        *)
+            # ok to call ERROR here - the user specified something invalid.
+            # that should be brought to his attention
+            AC_MSG_ERROR([unknown Portals configuration.  Can not continue])
+            ;;
+    esac
+
+    AC_DEFINE_UNQUOTED([OMPI_PORTALS_HAVE_EVENT_UNLINK], 
+                        [$OMPI_PORTALS_HAVE_EVENT_UNLINK],
+                        [Does Portals send a PTL_EVENT_UNLINK event])
+
+    AC_DEFINE_UNQUOTED([OMPI_PORTALS_UTCP], [$OMPI_PORTALS_UTCP],
+                       [Use the UTCP reference implementation of Portals])
+
+    AC_DEFINE_UNQUOTED([OMPI_PORTALS_CRAYXT3], [$OMPI_PORTALS_CRAYXT3],
+                       [Use the Cray XT-3 implementation of Portals])
+    
+    AC_DEFINE_UNQUOTED([OMPI_PORTALS_CRAYXT3_MODEX], [$OMPI_PORTALS_CRAYXT3_MODEX],
+                       [Use the Cray XT-3 implementation of Portals using Modex])
+
+    # Add correct -I and -L flags
+    AS_IF([test -n "$with_portals"],
+          [AS_IF([test -d "$with_portals/include"],
+                 [check_portals_CPPFLAGS="-I$with_portals/include"
+                  CPPFLAGS="$CPPFLAGS $check_portals_CPPFLAGS"], [])
+           AS_IF([test -d "$with_portals/lib"],
+                 [check_portals_LDFLAGS="-L$with_portals/lib"
+                  LDFLAGS="$LDFLAGS $check_portals_LDFLAGS"], [])])
+
+    # Try to find all the portals libraries (this is not fun!)
+    if test -n "$with_portals_libs" ; then
+        check_portals_LIBS=""
+        for lib in $with_portals_libs ; do
+            check_portals_LIBS="$check_portals_LIBS -l$lib"
+        done
+    fi
+
+    # check for portals
+    LIBS="$LIBS $check_portals_LIBS"
+    AC_CHECK_HEADERS([${check_portals_header_prefix}portals3.h],
+        [AC_MSG_CHECKING([if possible to link Portals application])
+         AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${check_portals_header_prefix}portals3.h>], 
+                                         [int i; PtlInit(&i);])],
+              [AC_MSG_RESULT([yes])
+               ompi_check_portals_happy="yes"],
+              [AC_MSG_RESULT([no])
+               ompi_check_portals_happy="no"])],
+        [ompi_check_portals_happy="no"])
+
+    # Deal with static-only Portals UTCP libs.  See note in
+    # ompi/mca/common/portals/configure.m4.  Then possibly cry.
+    if test "$with_portals_config" = "utcp" ; then
+        if test "$1" != "common_portals" ; then
+            check_portals_LIBS=
+        fi
+    fi
+
+    # reset the flags for the next test
+    CPPFLAGS="$check_portals_save_CPPFLAGS"
+    LDFLAGS="$check_portals_save_LDFLAGS"
+    LIBS="$check_portals_save_LIBS"
+
+    $1_CPPFLAGS="$check_portals_CPPFLAGS"
+    $1_LDFLAGS="$check_portals_LDFLAGS"
+    $1_LIBS="$check_portals_LIBS"
+
+    AS_IF([test "$ompi_check_portals_happy" = "yes"],
+          [$2],
+          [AS_IF([test ! -z "$with_portals" -a "$with_portals" != "no"],
+                 [AC_MSG_ERROR([Portals support requested but not found.  Aborting])])
+           $3])
+])
+

config/ompi_check_psm.m4

+# -*- shell-script -*-
+#
+# 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.
+# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+# Copyright (c) 2004-2006 The Regents of the University of California.
+#                         All rights reserved.
+# Copyright (c) 2006      QLogic Corp. All rights reserved.
+# Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+# OMPI_CHECK_PSM(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if PSM 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_PSM],[
+    AC_ARG_WITH([psm],
+        [AC_HELP_STRING([--with-psm(=DIR)],
+             [Build PSM (Qlogic InfiniPath) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
+    OMPI_CHECK_WITHDIR([psm], [$with_psm], [include/psm.h])
+    AC_ARG_WITH([psm-libdir],
+        [AC_HELP_STRING([--with-psm-libdir=DIR],
+             [Search for PSM (QLogic InfiniPath PSM) libraries in DIR])])
+    OMPI_CHECK_WITHDIR([psm-libdir], [$with_psm_libdir], [libpsm_infinipath.*])
+
+    ompi_check_psm_$1_save_CPPFLAGS="$CPPFLAGS"
+    ompi_check_psm_$1_save_LDFLAGS="$LDFLAGS"
+    ompi_check_psm_$1_save_LIBS="$LIBS"
+
+    AS_IF([test "$with_psm" != "no"],
+          [AS_IF([test ! -z "$with_psm" -a "$with_psm" != "yes"],
+                 [ompi_check_psm_dir="$with_psm"])
+           AS_IF([test ! -z "$with_psm_libdir" -a "$with_psm_libdir" != "yes"],
+                 [ompi_check_psm_libdir="$with_psm_libdir"])
+
+           OMPI_CHECK_PACKAGE([$1],
+                              [psm.h],
+                              [psm_infinipath],
+                              [psm_finalize],
+			      [],
+                              [$ompi_check_psm_dir],
+                              [$ompi_check_psm_libdir],
+                              [ompi_check_psm_happy="yes"],
+                              [ompi_check_psm_happy="no"])],
+          [ompi_check_psm_happy="no"])
+
+    CPPFLAGS="$ompi_check_psm_$1_save_CPPFLAGS"
+    LDFLAGS="$ompi_check_psm_$1_save_LDFLAGS"
+    LIBS="$ompi_check_psm_$1_save_LIBS"
+
+    AS_IF([test "$ompi_check_psm_happy" = "yes" -a "$enable_progress_threads" = "yes"],
+          [AC_MSG_WARN([PSM driver does not currently support progress threads.  Disabling BTL.])
+           ompi_check_psm_happy="no"])
+
+    AS_IF([test "$ompi_check_psm_happy" = "yes"],
+          [$2],
+          [AS_IF([test ! -z "$with_psm" -a "$with_psm" != "no"],
+                 [AC_MSG_ERROR([PSM support requested but not found.  Aborting])])
+           $3])
+])
+

config/ompi_check_pvfs2.m4

+# -*- shell-script -*-
+#
+# 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.
+# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+# Copyright (c) 2004-2006 The Regents of the University of California.
+#                         All rights reserved.
+# Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
+# Copyright (c) 2008-2012 University of Houston. All rights reserved.
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+# OMPI_CHECK_PVFS2(prefix, [action-if-found], [action-if-not-found])
+# --------------------------------------------------------
+# check if PVFS2 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_PVFS2],[
+
+    check_pvfs2_CPPFLAGS=
+    check_pvfs2_LDFLAGS=
+    check_pvfs2_LIBS=
+
+    check_pvfs2_save_LIBS="$LIBS" 
+    check_pvfs2_save_LDFLAGS="$LDFLAGS"
+    check_pvfs2_save_CPPFLAGS="$CPPFLAGS"
+
+    check_pvfs2_configuration="none"
+    ompi_check_pvfs2_happy="yes"
+
+
+    # Get some configuration information
+    AC_ARG_WITH([pvfs2],
+        [AC_HELP_STRING([--with-pvfs2(=DIR)],