Skip to content

Commit

Permalink
fix(build): check features before mangling CFLAGS
Browse files Browse the repository at this point in the history
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: aws#589, branch: aws-nslick/stack/31
  • Loading branch information
aws-nslick committed Sep 22, 2024
1 parent 66334c9 commit 0d3be4a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0d3be4a

Please sign in to comment.