Skip to content

Commit 1fe8ca9

Browse files
committed
Do not run PMIX/PRRTE configure when not needed
If the user specifies an external PMIX or PRRTE (or disables PRRTE), skip running the sub-configure script. The advantage of this change is that it gives the user a way out (an external build) if there is an error in our configure logic for the sub projects (which has recently happened). The down side is that "make dist" is broken whenever OMPI is configured against an external PMIX/PRRTE library or PRRTE is disabled. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 880ba67 commit 1fe8ca9

File tree

2 files changed

+62
-48
lines changed

2 files changed

+62
-48
lines changed

config/ompi_setup_prrte.m4

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,21 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
4545
4646
OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1])
4747
48-
m4_ifdef([package_prrte],
49-
[OMPI_PRRTE_ADD_ARGS])
50-
5148
prrte_setup_internal_happy=0
52-
m4_ifdef([package_prrte], [
53-
# always configure the internal prrte, so that
54-
# make dist always works.
55-
AS_IF([test "$opal_prrte_mode" = "disabled"], [prrte_setup_success_var=0], [prrte_setup_success_var=1])
56-
_OMPI_SETUP_PRRTE_INTERNAL([prrte_setup_internal_happy=$prrte_setup_success_var])])
49+
m4_ifdef([package_prrte],
50+
[OMPI_PRRTE_ADD_ARGS
51+
AS_IF([test "$opal_prrte_mode" = "unspecified" -o "$opal_prrte_mode" = "internal"],
52+
[# Run PRRTE's configure script unless the user
53+
# explicitly asked us to use an external PMIX, so that
54+
# "make dist" includes PRRTE in the dist tarball. This
55+
# does mean that "make dist" will not work if Open MPI
56+
# was configured to use an external PRRTE library, but
57+
# we decided this was a reasonable tradeoff for not
58+
# having to deal with PRRTE (or PMIx) potentially
59+
# failing to configure in a situation where it isn't
60+
# desired.
61+
_OMPI_SETUP_PRRTE_INTERNAL([prrte_setup_internal_happy=1],
62+
[prrte_setup_internal_happy=0])])])
5763
5864
# unless internal specifically requested by the user, try to find
5965
# an external that works.

config/opal_config_pmix.m4

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dnl and Technology (RIST). All rights reserved.
1919
dnl Copyright (c) 2016-2021 IBM Corporation. All rights reserved.
2020
dnl Copyright (c) 2020 Triad National Security, LLC. All rights
2121
dnl reserved.
22-
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
22+
dnl Copyright (c) 2020-2021 Amazon.com, Inc. or its affiliates. All Rights
2323
dnl reserved.
2424
dnl Copyright (c) 2021 Nanook Consulting. All rights reserved.
2525
dnl $COPYRIGHT$
@@ -68,45 +68,53 @@ AC_DEFUN([OPAL_CONFIG_PMIX], [
6868
6969
internal_pmix_happy=0
7070
m4_ifdef([package_pmix],
71-
[# always configure the internal pmix, so that
72-
# make dist always works.
73-
internal_pmix_args="--without-tests-examples --enable-pmix-binaries --disable-pmix-backward-compatibility --disable-visibility"
74-
internal_pmix_libs=
75-
internal_pmix_CPPFLAGS=
76-
77-
OMPI_PMIX_ADD_ARGS
78-
79-
AS_IF([test "$opal_libevent_mode" = "internal"],
80-
[internal_pmix_args="$internal_pmix_args --with-libevent=cobuild"
81-
internal_pmix_CPPFLAGS="$internal_pmix_CPPFLAGS $opal_libevent_CPPFLAGS"
82-
internal_pmix_libs="$internal_pmix_libs $opal_libevent_LIBS"])
83-
84-
AS_IF([test "$opal_hwloc_mode" = "internal"],
85-
[internal_pmix_args="$internal_pmix_args --with-hwloc=cobuild"
86-
internal_pmix_CPPFLAGS="$internal_pmix_CPPFLAGS $opal_hwloc_CPPFLAGS"
87-
internal_pmix_libs="$internal_pmix_libs $opal_hwloc_LIBS"])
88-
89-
AS_IF([test ! -z "$internal_pmix_libs"],
90-
[internal_pmix_args="$internal_pmix_args --with-pmix-extra-lib=\"$internal_pmix_libs\""])
91-
92-
if test "$WANT_DEBUG" = "1"; then
93-
internal_pmix_args="$internal_pmix_args --enable-debug"
94-
fi
95-
96-
# Pass all our compiler/linker flags to PMIx, so that it
97-
# picks up how to build an internal HWLOC and libevent, plus
98-
# picks up any user-specified compiler flags from the master
99-
# configure run.
100-
OPAL_SUBDIR_ENV_CLEAN([opal_pmix_configure])
101-
AS_IF([test -n "$internal_pmix_CPPFLAGS"],
102-
[OPAL_SUBDIR_ENV_APPEND([CPPFLAGS], [$internal_pmix_CPPFLAGS])])
103-
PAC_CONFIG_SUBDIR_ARGS([3rd-party/openpmix], [$internal_pmix_args],
104-
[[--with-libevent=internal], [--with-hwloc=internal],
105-
[--with-libevent=external], [--with-hwloc=external],
106-
[--with-pmix=[[^ ]]*], [--with-platform=[[^ ]]*]],
107-
[internal_pmix_happy=1])
108-
OPAL_SUBDIR_ENV_RESTORE([opal_pmix_configure])
109-
OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS openpmix"])
71+
[OMPI_PMIX_ADD_ARGS
72+
AS_IF([test "$opal_pmix_mode" = "unspecified" -o "$opal_pmix_mode" = "internal"],
73+
[# Run PMIx's configure script unless the user
74+
# explicitly asked us to use an external PMIX, so that
75+
# "make dist" includes PMIx in the dist tarball. This
76+
# does mean that "make dist" will not work if Open MPI
77+
# was configured to use an external PMIx library, but
78+
# we decided this was a reasonable tradeoff for not
79+
# having to deal with PMIx (or PRRTE) potentially
80+
# failing to configure in a situation where it isn't
81+
# desired.
82+
83+
internal_pmix_args="--without-tests-examples --enable-pmix-binaries --disable-pmix-backward-compatibility --disable-visibility"
84+
internal_pmix_libs=
85+
internal_pmix_CPPFLAGS=
86+
87+
AS_IF([test "$opal_libevent_mode" = "internal"],
88+
[internal_pmix_args="$internal_pmix_args --with-libevent=cobuild"
89+
internal_pmix_CPPFLAGS="$internal_pmix_CPPFLAGS $opal_libevent_CPPFLAGS"
90+
internal_pmix_libs="$internal_pmix_libs $opal_libevent_LIBS"])
91+
92+
AS_IF([test "$opal_hwloc_mode" = "internal"],
93+
[internal_pmix_args="$internal_pmix_args --with-hwloc=cobuild"
94+
internal_pmix_CPPFLAGS="$internal_pmix_CPPFLAGS $opal_hwloc_CPPFLAGS"
95+
internal_pmix_libs="$internal_pmix_libs $opal_hwloc_LIBS"])
96+
97+
AS_IF([test ! -z "$internal_pmix_libs"],
98+
[internal_pmix_args="$internal_pmix_args --with-pmix-extra-lib=\"$internal_pmix_libs\""])
99+
100+
if test "$WANT_DEBUG" = "1"; then
101+
internal_pmix_args="$internal_pmix_args --enable-debug"
102+
fi
103+
104+
# Pass all our compiler/linker flags to PMIx, so that it
105+
# picks up how to build an internal HWLOC and libevent, plus
106+
# picks up any user-specified compiler flags from the master
107+
# configure run.
108+
OPAL_SUBDIR_ENV_CLEAN([opal_pmix_configure])
109+
AS_IF([test -n "$internal_pmix_CPPFLAGS"],
110+
[OPAL_SUBDIR_ENV_APPEND([CPPFLAGS], [$internal_pmix_CPPFLAGS])])
111+
PAC_CONFIG_SUBDIR_ARGS([3rd-party/openpmix], [$internal_pmix_args],
112+
[[--with-libevent=internal], [--with-hwloc=internal],
113+
[--with-libevent=external], [--with-hwloc=external],
114+
[--with-pmix=[[^ ]]*], [--with-platform=[[^ ]]*]],
115+
[internal_pmix_happy=1])
116+
OPAL_SUBDIR_ENV_RESTORE([opal_pmix_configure])
117+
OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS openpmix"])])
110118
111119
# unless internal specifically requested by the user, try to find
112120
# an external that works.

0 commit comments

Comments
 (0)