From 72e9465925d55f547b0e0766104e3ef7952c4121 Mon Sep 17 00:00:00 2001 From: "Pavel Shamis (Pasha)" Date: Fri, 14 Nov 2014 11:52:45 -0500 Subject: [PATCH] Updating m4 script for IB --- config/m4/ib.m4 | 49 +++++++++++++++++++-------------------------- src/uct/Makefile.am | 1 - 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/config/m4/ib.m4 b/config/m4/ib.m4 index c1bfa145235..6eea4af3e18 100644 --- a/config/m4/ib.m4 +++ b/config/m4/ib.m4 @@ -5,13 +5,26 @@ # $HEADER$ # - # # Select IB transports # with_ib=no - +# +# Check basic IB support: User wanted at least one IB transport, and we found +# verbs header file and library. +# +AS_IF([test "x$with_ib" != xno], + [AC_CHECK_HEADER([infiniband/verbs.h], [], + [AC_MSG_WARN([ibverbs header files not found]);with_ib=no]) + save_LDFLAGS="$LDFLAGS" + AC_CHECK_LIB([ibverbs], [ibv_get_device_list], + [AC_SUBST(IBVERBS_LDFLAGS, [-libverbs])], + [AC_MSG_WARN([libibverbs not found]);with_ib=no]) + LDFLAGS="$save_LDFLAGS" + ]) +AS_IF([test "x$with_ib" != xno], + [AC_DEFINE([HAVE_IB], 1, [IB support])]) # # RC Support # @@ -19,53 +32,33 @@ AC_ARG_WITH([rc], [AC_HELP_STRING([--with-rc], [Compile with IB Reliable Connection support])], [], [with_rc=yes]) -AS_IF([test "x$with_rc" != xno], +AS_IF([test "x$with_rc" != xno -a "x$with_ib" != xno], [AC_DEFINE([HAVE_TL_RC], 1, [RC transport support]) - with_ib=yes transports="${transports},rc"]) AC_ARG_WITH([ud], [AC_HELP_STRING([--with-ud], [Compile with IB Unreliable Datagram support])], [], - [with_ud=yes;with_ib=yes]) -AS_IF([test "x$with_ud" != xno], + [with_ud=yes]) +AS_IF([test "x$with_ud" != xno -a "x$with_ib" != xno], [AC_DEFINE([HAVE_TL_UD], 1, [UD transport support]) - with_ib=yes transports="${transports},ud"]) AC_ARG_WITH([dc], [AC_HELP_STRING([--with-dc], [Compile with IB Dynamic Connection support])], [], - [with_dc=yes;with_ib=yes]) -AS_IF([test "x$with_dc" != xno], + [with_dc=yes]) +AS_IF([test "x$with_dc" != xno -a "x$with_ib" != xno], [AC_CHECK_DECLS(IBV_EXP_QPT_DC_INI, [], [with_dc=no], [[#include ]]) AC_CHECK_MEMBERS([struct ibv_exp_dct_init_attr.inline_size], [] , [with_dc=no], [[#include ]]) ]) -AS_IF([test "x$with_dc" != xno], +AS_IF([test "x$with_dc" != xno -a "x$with_ib" != xno], [AC_DEFINE([HAVE_TL_DC], 1, [DC transport support]) - with_ib=yes transports="${transports},dc"]) -# -# Check basic IB support: User wanted at least one IB transport, and we found -# verbs header file and library. -# -AS_IF([test "x$with_ib" != xno], - [AC_CHECK_HEADER([infiniband/verbs.h], [], - [AC_MSG_WARN([ibverbs header files not found]);with_ib=no]) - save_LDFLAGS="$LDFLAGS" - AC_CHECK_LIB([ibverbs], [ibv_get_device_list], - [AC_SUBST(IBVERBS_LDFLAGS, [-libverbs])], - [AC_MSG_WARN([libibverbs not found]);with_ib=no]) - LDFLAGS="$save_LDFLAGS" - ]) -AS_IF([test "x$with_ib" != xno], - [AC_DEFINE([HAVE_IB], 1, [IB support])]) - - # # Check for experimental verbs support # diff --git a/src/uct/Makefile.am b/src/uct/Makefile.am index bbf569098b2..ed0e44437a1 100644 --- a/src/uct/Makefile.am +++ b/src/uct/Makefile.am @@ -54,4 +54,3 @@ libuct_la_SOURCES += \ ib/mlx5/ib_mlx5.c endif endif -