Skip to content

Commit

Permalink
Error if Libfabric is too old
Browse files Browse the repository at this point in the history
Rather than throw weird compiler errors, have configure abort if
Libfabric is older than our published supported version (1.11.0).

Signed-off-by: Brian Barrett <bbarrett@amazon.com>
(cherry picked from commit 48574c1)
  • Loading branch information
bwbarrett committed Jul 21, 2023
1 parent 3cdcb0f commit d520367
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions m4/check_pkg_libfabric.m4
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,26 @@ AC_DEFUN([CHECK_PKG_LIBFABRIC], [
AS_IF([test "${check_pkg_found}" = "yes"],
[AC_SEARCH_LIBS([fi_getinfo], [fabric], [], [check_pkg_found=no])])
AC_CHECK_HEADERS([rdma/fi_ext.h])
AS_IF([test "${check_pkg_found}" = "yes"],
[AC_MSG_CHECKING([for Libfabric 1.11.0 or later])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <rdma/fabric.h>
]],
[[#if !defined(FI_MAJOR_VERSION)
#error "we cannot check the version -- sad panda"
#elif FI_VERSION_LT(FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION), FI_VERSION(1,11))
#error "version is too low -- nopes"
#endif
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
check_pkg_found=no])])
AS_IF([test "${check_pkg_found}" = "yes"],
[AC_CHECK_HEADERS([rdma/fi_ext.h])])
AC_CHECK_DECLS([FI_OPT_CUDA_API_PERMITTED,
AS_IF([test "${check_pkg_found}" = "yes"],
[AC_CHECK_DECLS([FI_OPT_CUDA_API_PERMITTED,
FI_OPT_EFA_USE_DEVICE_RDMA,
FI_OPT_EFA_EMULATED_WRITE,
FI_OPT_EFA_SENDRECV_IN_ORDER_ALIGNED_128_BYTES,
Expand All @@ -42,7 +59,7 @@ AC_DEFUN([CHECK_PKG_LIBFABRIC], [
[#include <rdma/fi_endpoint.h>
#ifdef HAVE_RDMA_FI_EXT_H
#include <rdma/fi_ext.h>
#endif]])
#endif]])])
AS_IF([test "${check_pkg_found}" = "yes"],
[$1],
Expand Down

0 comments on commit d520367

Please sign in to comment.