Skip to content

Commit

Permalink
TL/MLX5: adding with-rdmacm config flag (#824)
Browse files Browse the repository at this point in the history
Co-authored-by: Manjunath Gorentla Venkata <[email protected]>
  • Loading branch information
MamziB and manjugv authored Aug 21, 2023
1 parent f89cd75 commit 3da88f1
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
92 changes: 92 additions & 0 deletions config/m4/rdmacm.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# See file LICENSE for terms.
#

AC_DEFUN([CHECK_RDMACM],[
AS_IF([test "x$rdmacm_checked" != "xyes"],[
rdmacm_happy="no"
AC_ARG_WITH([rdmacm],
[AS_HELP_STRING([--with-rdmacm=(DIR)], [Enable the use of rdmacm (default is guess).])],
[], [with_rdmacm=guess])
AS_IF([test "x$with_rdmacm" != "xno"],
[
save_CPPFLAGS="$CPPFLAGS"
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
AS_IF([test ! -z "$with_rdmacm" -a "x$with_rdmacm" != "xyes" -a "x$with_rdmacm" != "xguess"],
[
AS_IF([test ! -d $with_rdmacm],
[AC_MSG_ERROR([Provided "--with-rdmacm=${with_rdmacm}" location does not exist])], [])
check_rdmacm_dir="$with_rdmacm"
],
[
check_rdmacm_dir="/usr"
]
)
AS_IF([test -d "$check_rdmacm_dir/lib64"],[libsuff="64"],[libsuff=""])
check_rdmacm_libdir="$check_rdmacm_dir/lib$libsuff"
CPPFLAGS="-I$check_rdmacm_dir/include $save_CPPFLAGS"
LDFLAGS="-L$check_rdmacm_libdir $save_LDFLAGS"
AC_CHECK_HEADER([$check_rdmacm_dir/include/rdma/rdma_cma.h],
[
AC_CHECK_LIB([rdmacm], [rdma_establish],
[
rdmacm_happy="yes"
],
[
rdmacm_happy="no"
])
],
[
AC_MSG_WARN([rdmacm header files not found])
rdmacm_happy=no
])
AS_IF([test "x$rdmacm_happy" = "xyes"],
[
AS_IF([test "x$check_rdmacm_dir" != "x"],
[
AC_MSG_RESULT([rdmacm dir: $check_rdmacm_dir])
AC_SUBST(RDMACM_CPPFLAGS, "-I$check_rdmacm_dir/include/")
])
AS_IF([test "x$check_rdmacm_libdir" != "x"],
[
AC_SUBST(RDMACM_LDFLAGS, "-L$check_rdmacm_libdir")
])
AC_SUBST(RDMACM_LIBADD, "-lrdmacm")
AC_DEFINE([HAVE_RDMACM], [1], [rdmacm support])
],
[
AS_IF([test "x$with_rdmacm" != "xguess"],
[
AC_MSG_ERROR([rdmacm support is requested but rdmacm packages cannot be found $CPPFLAGS $LDFLAGS])
],
[
AC_MSG_WARN([rdmacm not found])
])
])
CFLAGS="$save_CFLAGS"
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
],
[
AC_MSG_WARN([rdmacm was explicitly disabled])
])
rdmacm_checked=yes
AM_CONDITIONAL([HAVE_RDMACM], [test "x$rdmacm_happy" != xno])
])
])
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ AS_IF([test "x$with_docs_only" = xyes],
AM_CONDITIONAL([HAVE_MPICXX], [false])
AM_CONDITIONAL([HAVE_PROFILING],[false])
AM_CONDITIONAL([HAVE_IBVERBS],[false])
AM_CONDITIONAL([HAVE_RDMACM],[false])
AM_CONDITIONAL([HAVE_MLX5DV],[false])
],
[
Expand All @@ -175,6 +176,7 @@ AS_IF([test "x$with_docs_only" = xyes],
m4_include([config/m4/sharp.m4])
m4_include([config/m4/mpi.m4])
m4_include([config/m4/ibverbs.m4])
m4_include([config/m4/rdmacm.m4])
m4_include([config/m4/configure.m4])
m4_include([config/m4/tl_coll_plugins.m4])
m4_include([config/m4/check_tls.m4])
Expand Down Expand Up @@ -208,6 +210,9 @@ AS_IF([test "x$with_docs_only" = xyes],
CHECK_IBVERBS
AC_MSG_RESULT([IBVERBS support: $ibverbs_happy, MLX5DV support: $mlx5dv_happy])
CHECK_RDMACM
AC_MSG_RESULT([RDMACM support: $rdmacm_happy])
]) # Docs only


Expand Down
5 changes: 4 additions & 1 deletion src/components/tl/mlx5/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ tl_mlx5_enabled=n
CHECK_TLS_REQUIRED(["mlx5"])
AS_IF([test "$CHECKED_TL_REQUIRED" = "y"],
[
CHECK_RDMACM
AC_MSG_RESULT([RDMACM support: $rdmacm_happy])
mlx5_happy=no
if test "x$mlx5dv_happy" = "xyes" -a "x$have_mlx5dv_wr_raw_wqe" = "xyes"; then
if test "x$mlx5dv_happy" = "xyes" -a "x$have_mlx5dv_wr_raw_wqe" = "xyes" -a "x$rdmacm_happy" = "xyes"; then
mlx5_happy=yes
fi
AC_MSG_RESULT([MLX5 support: $mlx5_happy])
Expand Down

0 comments on commit 3da88f1

Please sign in to comment.