diff --git a/config/ompi_check_openib.m4 b/config/ompi_check_openib.m4 index 02e13c096c..5b87003f7f 100644 --- a/config/ompi_check_openib.m4 +++ b/config/ompi_check_openib.m4 @@ -187,6 +187,18 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[ fi ]) + # Check to see if 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]) diff --git a/ompi/mca/btl/openib/btl_openib_component.c b/ompi/mca/btl/openib/btl_openib_component.c index 518be786dd..63628bb191 100644 --- a/ompi/mca/btl/openib/btl_openib_component.c +++ b/ompi/mca/btl/openib/btl_openib_component.c @@ -25,9 +25,19 @@ #include "ompi_config.h" #include +/* This is crummy, but doesn't work on all + platforms with all compilers. Specifically, trying to include it + on RHEL4U3 with the PGI 32 bit compiler will cause problems because + certain 64 bit types are not defined. Per advice from Roland D., + just include the one prototype that we need in this case + (ibv_get_sysfs_path()). */ +#ifdef HAVE_INFINIBAND_DRIVER_H #include +#else +const char *ibv_get_sysfs_path(void); +#endif #include -#include /* for strerror()*/ +#include #include #include #include