From 201ec509ce6764f5154ae38fa766a30f0dacebc0 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 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. stack-info: PR: https://github.com/aws/aws-ofi-nccl/pull/589, branch: aws-nslick/stack/31 --- configure.ac | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 6e68a27e1..4340d4ce1 100644 --- a/configure.ac +++ b/configure.ac @@ -104,6 +104,16 @@ CHECK_PKG_HWLOC([], CHECK_PKG_VALGRIND() CHECK_VAR_REDZONE() +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() + # do we want our tests? CHECK_PKG_MPI([found_mpi="yes"], [found_mpi="no"]) @@ -148,16 +158,6 @@ 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