From f6f575af6fc7429356fd53613600ee935df3d513 Mon Sep 17 00:00:00 2001 From: Nicholas Sielicki Date: Wed, 11 Sep 2024 15:21:47 -0700 Subject: [PATCH] fix(build): check features before mangling CFLAGS (#589) Yet another autotools fix: If any warning/devel CFLAGS would invoke warnings in headers used to detect dependencies, those dependencies will fail with a highly misleading/confusing error message: > configure: Found .git directory. Adding -Werror to CFLAGS. > checking if running on EC2 instance... yes > checking if want AWS platform optimizations... yes > checking for Libfabric 1.18.0 or later... no > configure: error: On AWS platforms, Libfabric 1.18.0 or later is required ie: it is not that Libfabric 1.18 was not found, it was that its headers produced warnings. Fix this by resolving all dependencies before modifying CFLAGS. Signed-off-by: Nicholas Sielicki --- configure.ac | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 019ab89db..8096ed2cd 100644 --- a/configure.ac +++ b/configure.ac @@ -125,6 +125,14 @@ CHECK_PKG_HWLOC([], CHECK_PKG_VALGRIND() CHECK_VAR_REDZONE() +NCCL_OFI_PLATFORM="none" +AS_IF([test "${NCCL_OFI_PLATFORM}" = "none"], [AX_CHECK_PLATFORM_AWS()]) + +AS_IF([test "${valgrind_enabled}" = "1" -a "${enable_asan}" = "yes"], + [AC_MSG_ERROR([Enabling ASAN and valgrind at the same time is not permitted])]) + +CHECK_ENABLE_MEMFD_CREATE() + # do we want our tests? CHECK_PKG_MPI([found_mpi="yes"], [found_mpi="no"]) @@ -169,16 +177,8 @@ AS_IF([test -d "${srcdir}/.git" -a -z "${enable_werror}"], [AC_MSG_NOTICE([Adding ${werror_flags} to CFLAGS.]) CFLAGS="${CFLAGS} ${werror_flags}"]) -NCCL_OFI_PLATFORM="none" -AS_IF([test "${NCCL_OFI_PLATFORM}" = "none"], [AX_CHECK_PLATFORM_AWS()]) - AC_SUBST([NCCL_NET_OFI_DISTCHCK_CONFIGURE_FLAGS]) -AS_IF([test "${valgrind_enabled}" = "1" -a "${enable_asan}" = "yes"], - [AC_MSG_ERROR([Enabling ASAN and valgrind at the same time is not permitted])]) - -CHECK_ENABLE_MEMFD_CREATE() - AC_CONFIG_FILES([Makefile include/Makefile src/Makefile