Skip to content

Commit

Permalink
build: Clean up delayed flags
Browse files Browse the repository at this point in the history
Rename PMIX_FINAL_LIBS to PMIX_DELAYED_LIBS to make it slightly more
clear what the variable is for, and add a comment in pmix.m4
explaining its use.

Remove PMIX_FINAL_CPPFLAGS and PMIX_FINAL_LDFLAGS, since there is
no clear need to delay adding either set of flags, and they
just make things more complicated for everyone.

Signed-off-by: Brian Barrett <bbarrett@amazon.com>
  • Loading branch information
bwbarrett authored and rhc54 committed Mar 18, 2022
1 parent a1a5935 commit 2a34472
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 33 deletions.
9 changes: 6 additions & 3 deletions config/pmix.m4
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,12 @@ AC_DEFUN([PMIX_SETUP_CORE],[
cpp_includes="$PMIX_top_srcdir $PMIX_top_srcdir/src"
fi
CPP_INCLUDES="$(echo $cpp_includes | $SED 's/[[^ \]]* */'"$pmix_cc_iquote"'&/g')"
CPPFLAGS="$PMIX_FINAL_CPPFLAGS $CPP_INCLUDES -I$PMIX_top_srcdir/include $CPPFLAGS"
LDFLAGS="$PMIX_FINAL_LDFLAGS $LDFLAGS"
LIBS="$PMIX_FINAL_LIBS $LIBS"
CPPFLAGS="$CPP_INCLUDES -I$PMIX_top_srcdir/include $CPPFLAGS"
# PMIX_DELAYED_LIBS is used to allow us to add some libraries to the build, but
# not add them to all the tests that are run through configure, since that
# can cause some bundled build situations. This is the last minute, so time
# to add them to LIBS.
PMIX_FLAGS_APPEND_MOVE([LIBS], [$PMIX_DELAYED_LIBS])

############################################################################
# final wrapper compiler config
Expand Down
2 changes: 0 additions & 2 deletions config/pmix_search_libs.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ dnl
# PMIX_SEARCH_LIBS_COMPONENT. The reason why is because this macro
# calls PMIX_WRAPPER_FLAGS_ADD -- see big comment in
# pmix_setup_wrappers.m4 for an explanation of why this is bad).
# NOTE: PMIx doesn't have wrapper compilers, so this is not an issue
# here - we leave the note just for downstream compatibility
AC_DEFUN([PMIX_SEARCH_LIBS_CORE],[

PMIX_VAR_SCOPE_PUSH([LIBS_save add])
Expand Down
34 changes: 14 additions & 20 deletions config/pmix_setup_hwloc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# MCA_hwloc_CONFIG([action-if-found], [action-if-not-found])
# --------------------------------------------------------------------
AC_DEFUN([PMIX_SETUP_HWLOC],[
PMIX_VAR_SCOPE_PUSH([pmix_hwloc_dir pmix_hwloc_libdir pmix_check_hwloc_save_CPPFLAGS pmix_check_hwloc_save_LDFLAGS pmix_check_hwloc_save_LIBS])
PMIX_VAR_SCOPE_PUSH([pmix_hwloc_dir pmix_hwloc_libdir pmix_check_hwloc_save_CPPFLAGS])
AC_ARG_WITH([hwloc],
[AS_HELP_STRING([--with-hwloc=DIR],
Expand All @@ -33,8 +33,6 @@ AC_DEFUN([PMIX_SETUP_HWLOC],[
pmix_hwloc_support=1
pmix_check_hwloc_save_CPPFLAGS="$CPPFLAGS"
pmix_check_hwloc_save_LDFLAGS="$LDFLAGS"
pmix_check_hwloc_save_LIBS="$LIBS"
pmix_have_topology_dup=0
if test "$with_hwloc" == "no"; then
Expand All @@ -54,7 +52,7 @@ AC_DEFUN([PMIX_SETUP_HWLOC],[
[hwloc_topology_init],
[],
[pmix_hwloc_support=0])],
[PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LIBS], [$with_hwloc_extra_libs])])
[PMIX_FLAGS_APPEND_UNIQ([PMIX_DELAYED_LIBS], [$with_hwloc_extra_libs])])
if test $pmix_hwloc_support -eq 0; then
AC_MSG_WARN([PMIx requires HWLOC topology library support, but])
Expand All @@ -66,17 +64,6 @@ AC_DEFUN([PMIX_SETUP_HWLOC],[
# update global flags to test for HWLOC version
PMIX_FLAGS_PREPEND_UNIQ([CPPFLAGS], [$pmix_hwloc_CPPFLAGS])
PMIX_WRAPPER_FLAGS_ADD([CPPFLAGS], [$pmix_hwloc_CPPFLAGS])
PMIX_FLAGS_PREPEND_UNIQ([LDFLAGS], [$pmix_hwloc_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([LDFLAGS], [$pmix_hwloc_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [$pmix_hwloc_STATIC_LDFLAGS])
PMIX_FLAGS_PREPEND_UNIQ([LIBS], [$pmix_hwloc_LIBS])
PMIX_WRAPPER_FLAGS_ADD([LIBS], [$pmix_hwloc_LIBS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LIBS], [$pmix_hwloc_STATIC_LIBS])
PMIX_WRAPPER_FLAGS_ADD([PC_MODULES], [$pmix_hwloc_PC_MODULES])
AC_MSG_CHECKING([if hwloc version is 1.5 or greater])
AC_COMPILE_IFELSE(
Expand Down Expand Up @@ -116,12 +103,19 @@ AC_DEFUN([PMIX_SETUP_HWLOC],[
pmix_version_high=0])
CPPFLAGS=$pmix_check_hwloc_save_CPPFLAGS
LDFLAGS=$pmix_check_hwloc_save_LDFLAGS
LIBS=$pmix_check_hwloc_save_LIBS
PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_CPPFLAGS], [$pmix_hwloc_CPPFLAGS])
PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LDFLAGS], [$pmix_hwloc_LDFLAGS])
PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LIBS], [$pmix_hwloc_LIBS])
PMIX_FLAGS_APPEND_UNIQ([CPPFLAGS], [$pmix_hwloc_CPPFLAGS])
PMIX_WRAPPER_FLAGS_ADD([CPPFLAGS], [$pmix_hwloc_CPPFLAGS])
PMIX_FLAGS_APPEND_UNIQ([LDFLAGS], [$pmix_hwloc_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([LDFLAGS], [$pmix_hwloc_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [$pmix_hwloc_STATIC_LDFLAGS])
PMIX_FLAGS_APPEND_UNIQ([PMIX_DELAYED_LIBS], [$pmix_hwloc_LIBS])
PMIX_WRAPPER_FLAGS_ADD([LIBS], [$pmix_hwloc_LIBS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LIBS], [$pmix_hwloc_STATIC_LIBS])
PMIX_WRAPPER_FLAGS_ADD([PC_MODULES], [$pmix_hwloc_PC_MODULES])
AC_DEFINE_UNQUOTED([PMIX_HAVE_HWLOC_TOPOLOGY_DUP], [$pmix_have_topology_dup],
[Whether or not hwloc_topology_dup is available])
Expand Down
8 changes: 4 additions & 4 deletions config/pmix_setup_libev.m4
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ AC_DEFUN([PMIX_LIBEV_CONFIG],[
[ev_async_send],
[],
[pmix_libev_support=0])],
[PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LIBS], [$with_libev_extra_libs])])
[PMIX_FLAGS_APPEND_UNIQ([PMIX_DELAYED_LIBS], [$with_libev_extra_libs])])

CPPFLAGS="$pmix_check_libev_save_CPPFLAGS"
LDFLAGS="$pmix_check_libev_save_LDFLAGS"
LIBS="$pmix_check_libev_save_LIBS"])

AS_IF([test $pmix_libev_support -eq 1],
[PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_CPPFLAGS], [$pmix_libev_CPPFLAGS])
[PMIX_FLAGS_APPEND_UNIQ([CPPFLAGS], [$pmix_libev_CPPFLAGS])
PMIX_WRAPPER_FLAGS_ADD([CPPFLAGS], [$pmix_libev_CPPFLAGS])

PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LDFLAGS], [$pmix_libev_LDFLAGS])
PMIX_FLAGS_APPEND_UNIQ([LDFLAGS], [$pmix_libev_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([LDFLAGS], [$pmix_libev_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [$pmix_libev_STATIC_LDFLAGS])

PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LIBS], [$pmix_libev_LIBS])
PMIX_FLAGS_APPEND_UNIQ([PMIX_DELAYED_LIBS], [$pmix_libev_LIBS])
PMIX_WRAPPER_FLAGS_ADD([LIBS], [$pmix_libev_LIBS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LIBS], [$pmix_libev_STATIC_LIBS])

Expand Down
8 changes: 4 additions & 4 deletions config/pmix_setup_libevent.m4
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ AC_DEFUN([PMIX_LIBEVENT_CONFIG],[
[event_config_new],
[],
[pmix_libevent_support=0])],
[PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LIBS], [$with_libevent_extra_libs])])])
[PMIX_FLAGS_APPEND_UNIQ([PMIX_DELAYED_LIBS], [$with_libevent_extra_libs])])])
# Check to see if the above check failed because it conflicted with LSF's libevent.so
# This can happen if LSF's library is in the LDFLAGS envar or default search
Expand Down Expand Up @@ -158,14 +158,14 @@ AC_DEFUN([PMIX_LIBEVENT_CONFIG],[
AC_MSG_CHECKING([will libevent support be built])
if test $pmix_libevent_support -eq 1; then
AC_MSG_RESULT([yes])
PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_CPPFLAGS], [$pmix_libevent_CPPFLAGS])
PMIX_FLAGS_APPEND_UNIQ([CPPFLAGS], [$pmix_libevent_CPPFLAGS])
PMIX_WRAPPER_FLAGS_ADD([CPPFLAGS], [$pmix_libevent_CPPFLAGS])
PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LDFLAGS], [$pmix_libevent_LDFLAGS])
PMIX_FLAGS_APPEND_UNIQ([LDFLAGS], [$pmix_libevent_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([LDFLAGS], [$pmix_libevent_LDFLAGS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [$pmix_libevent_STATIC_LDFLAGS])
PMIX_FLAGS_APPEND_UNIQ([PMIX_FINAL_LIBS], [$pmix_libevent_LIBS])
PMIX_FLAGS_APPEND_UNIQ([PMIX_DELAYED_LIBS], [$pmix_libevent_LIBS])
PMIX_WRAPPER_FLAGS_ADD([LIBS], [$pmix_libevent_LIBS])
PMIX_WRAPPER_FLAGS_ADD([STATIC_LIBS], [$pmix_libevent_STATIC_LIBS])
Expand Down

0 comments on commit 2a34472

Please sign in to comment.