Skip to content

Commit 3fa077a

Browse files
authored
Merge pull request #9649 from bwbarrett/feature/no-subconfigures-if-external
Skip running PMIX/PRRTE configure when not needed
2 parents e822345 + 5a8fe8b commit 3fa077a

File tree

5 files changed

+129
-105
lines changed

5 files changed

+129
-105
lines changed

Makefile.am

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
1313
# Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights reserved.
1414
# Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
15-
# Copyright (c) 2017-2020 Amazon.com, Inc. or its affiliates.
15+
# Copyright (c) 2017-2021 Amazon.com, Inc. or its affiliates.
1616
# All Rights reserved.
1717
# Copyright (c) 2020 IBM Corporation. All rights reserved.
1818
# $COPYRIGHT$
@@ -34,6 +34,14 @@ dist-hook:
3434
echo "AUTHORS file is empty; aborting distribution"; \
3535
exit 1; \
3636
fi
37+
@if test -n "$(OPAL_MAKEDIST_DISABLE)" ; then \
38+
echo "#########################################################################"; \
39+
echo "#"; \
40+
echo "# make dist is disabled due to the following packages: $(OPAL_MAKEDIST_DISABLE)"; \
41+
echo "#"; \
42+
echo "#########################################################################"; \
43+
exit 1; \
44+
fi
3745

3846
# Check for common symbols. Use a "-hook" to increase the odds that a
3947
# developer will see it at the end of their installation process.

config/ompi_setup_prrte.m4

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
1616
dnl reserved.
1717
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
1818
dnl Copyright (c) 2019-2020 Intel, Inc. All rights reserved.
19-
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
19+
dnl Copyright (c) 2020-2021 Amazon.com, Inc. or its affiliates.
2020
dnl All Rights reserved.
2121
dnl Copyright (c) 2021 Nanook Consulting. All rights reserved.
2222
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
@@ -43,46 +43,28 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
4343
4444
opal_show_subtitle "Configuring PRRTE"
4545
46-
# Don't use OPAL_3RDPARTY_WITH because it will not allow packages
47-
# to be disabled
48-
m4_ifdef([package_prrte],
49-
[AC_ARG_WITH([prrte],
50-
[AS_HELP_STRING([--with-prrte(=DIR)],
51-
[Build PRTE support. DIR can take one of four values: "internal", "external", "no", or a valid directory name. "internal" forces Open MPI to use its internal copy of PRRTE. "external" forces Open MPI to use an external installation of PRRTE. Supplying a valid directory name also forces Open MPI to use an external installation of PRRTE, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. If no argument is specified, Open MPI will search default locations for PRRTE and fall back to an internal version if one is not found.])])],
52-
[AC_ARG_WITH([prrte],
53-
[AS_HELP_STRING([--with-prrte(=DIR)],
54-
[Build PRRTE support. DIR can take one of three values: "external", "no", or a valid directory name. "external" forces Open MPI to use an external installation of PRRTE. Supplying a valid directory name also forces Open MPI to use an external installation of PRRTE, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. If no argument is specified, Open MPI will search default locations for PRRTE and disable creating mpirun symlinks if one is not found.])])])
55-
56-
m4_ifdef([package_prrte],
57-
[OMPI_PRRTE_ADD_ARGS])
58-
59-
# clean up $with_prrte so that it contains only a path or empty
60-
# string. To determine internal or external preferences, use
61-
# $opal_prrte_mode.
62-
AS_IF([test "$with_prrte" = "yes"], [with_prrte=])
63-
AS_CASE([$with_prrte],
64-
["internal"], [with_prrte=""
65-
opal_prrte_mode="internal"],
66-
["external"], [with_prrte=""
67-
opal_prrte_mode="external"],
68-
[""], [opal_prrte_mode="unspecified"],
69-
["no"], [opal_prrte_mode="disabled"],
70-
[opal_prrte_mode="external"])
71-
72-
echo "with_prrte: $with_prrte"
73-
echo "opal_prrte_mode: $opal_prrte_mode"
74-
75-
m4_ifdef([package_prrte], [],
76-
[AS_IF([test "$opal_prrte_mode" = "internal"],
77-
[AC_MSG_WARN([Invalid argument to --with-prrte: internal.])
78-
AC_MSG_ERROR([Cannot continue])])])
46+
OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1])
7947
8048
prrte_setup_internal_happy=0
81-
m4_ifdef([package_prrte], [
82-
# always configure the internal prrte, so that
83-
# make dist always works.
84-
AS_IF([test "$opal_prrte_mode" = "disabled"], [prrte_setup_success_var=0], [prrte_setup_success_var=1])
85-
_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])])
63+
64+
# if we have a pmix package and configure did not complete
65+
# successfullly (or wasn't started), then disable make dist.
66+
AS_IF([test $prrte_setup_internal_happy != 1],
67+
[OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PRRTE"])])
8668
8769
# unless internal specifically requested by the user, try to find
8870
# an external that works.

config/opal_config_3rdparty.m4

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl Copyright (c) 2009-2018 Cisco Systems, Inc. All rights reserved
44
dnl Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
55
dnl Copyright (c) 2015-2018 Research Organization for Information Science
66
dnl and Technology (RIST). All rights reserved.
7-
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
7+
dnl Copyright (c) 2020-2021 Amazon.com, Inc. or its affiliates. All Rights
88
dnl reserved.
99
dnl $COPYRIGHT$
1010
dnl
@@ -13,44 +13,58 @@ dnl
1313
dnl $HEADER$
1414
dnl
1515

16-
dnl OPAL_3RDPARTY_WITH(short package name, long package name, internal supported)
16+
dnl OPAL_3RDPARTY_WITH(short package name, long package name,
17+
dnl internal supported, disabled ok)
1718
dnl
1819
dnl Basic --with-pkg/--with-pkg-libdir handling for 3rd party
1920
dnl packages, with the big long description of internal/external/path
2021
dnl handling.
2122
dnl
2223
dnl At the end of this macro, with_pkg will contain an empty string or
23-
dnl a path (implying external). Further, the shell variable opal_pkg_mode
24-
dnl will be set to "internal", "external", or "unspecified". If a path is
25-
dnl given to --with-pkg, then opal_pkg_mode will be set to external.
24+
dnl a path (the later implying external). Further, the shell variable
25+
dnl opal_pkg_mode will be set to "internal", "external",
26+
dnl "unspecified", or "disabled". If a path is given to --with-pkg, then
27+
dnl opal_pkg_mode will be set to external. If "internal supported" is
28+
dnl not defined, then opal_pkg_mode will not be internal. If
29+
dnl "disabled ok" is not defined, then opal_pkg_mode will not be
30+
dnl "disabled".
2631
dnl
2732
dnl If m4_ifdef(internal support) does not evaluate to true (ie, at
2833
dnl autogen time), the references to internal in the help strings will
2934
dnl be removed and internal will not be a supported option.
3035
dnl
36+
dnl If m4_ifval(ddisbaled ok) does not evaluete to true (ie, at autogen
37+
dnl time), then --without-pkg will not be a valid configure option and
38+
dnl will raise an error.
39+
dnl
3140
dnl $1: short package name
3241
dnl $2: long pacakage name
3342
AC_DEFUN([OPAL_3RDPARTY_WITH], [
34-
m4_ifdef([$3],
35-
[AC_ARG_WITH([$1],
36-
[AS_HELP_STRING([--with-$1(=DIR)],
37-
[Build $2 support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])
38-
39-
AC_ARG_WITH([$1-libdir],
40-
[AS_HELP_STRING([--with-$1-libdir=DIR],
41-
[Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])],
42-
[AC_ARG_WITH([$1],
43-
[AS_HELP_STRING([--with-$1(=DIR)],
44-
[Build $2 support. DIR can take one of two values: "external" or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])
43+
m4_ifval([$4],
44+
[m4_ifdef([$3],
45+
[AC_ARG_WITH([$1],
46+
[AS_HELP_STRING([--with-$1(=DIR)],
47+
[Build $2 support. DIR can take one of four values: "internal", "external", "no", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. "no" means that Open MPI will not build components that require this package. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])],
48+
[AC_ARG_WITH([$1],
49+
[AS_HELP_STRING([--with-$1(=DIR)],
50+
[Build $2 support. DIR can take one of three values: "external", "no", or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. "no" means that Open MPI will not build components that require this package. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])])],
51+
[m4_ifdef([$3],
52+
[AC_ARG_WITH([$1],
53+
[AS_HELP_STRING([--with-$1(=DIR)],
54+
[Build $2 support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])],
55+
[AC_ARG_WITH([$1],
56+
[AS_HELP_STRING([--with-$1(=DIR)],
57+
[Build $2 support. DIR can take one of two values: "external" or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])])])
4558
46-
AC_ARG_WITH([$1-libdir],
47-
[AS_HELP_STRING([--with-$1-libdir=DIR],
48-
[Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])])
59+
AC_ARG_WITH([$1-libdir],
60+
[AS_HELP_STRING([--with-$1-libdir=DIR],
61+
[Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])
4962
5063
# Bozo check
51-
AS_IF([test "$with_$1" = "no"],
52-
[AC_MSG_WARN([It is not possible to configure Open MPI --without-$1])
53-
AC_MSG_ERROR([Cannot continue])])
64+
m4_ifval([$4], [],
65+
[AS_IF([test "$with_$1" = "no"],
66+
[AC_MSG_WARN([It is not possible to configure Open MPI --without-$1])
67+
AC_MSG_ERROR([Cannot continue])])])
5468
5569
AS_IF([test "$with_$1_libdir" = "no" -o "$with_$1_libdir" = "yes"],
5670
[AC_MSG_WARN([yes/no are invalid responses for --with-$1-libdir. Please specify a path.])
@@ -73,6 +87,8 @@ AC_DEFUN([OPAL_3RDPARTY_WITH], [
7387
opal_$1_mode="internal"],
7488
["external"], [with_$1=""
7589
opal_$1_mode="external"],
90+
["no"], [with_$1=""
91+
opal_$1_mode="disabled"],
7692
[""], [opal_$1_mode="unspecified"],
7793
[opal_$1_mode="external"])
7894

config/opal_config_pmix.m4

Lines changed: 53 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,58 @@ 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"])
118+
119+
# if we have a pmix package and configure did not complete
120+
# successfullly (or wasn't started), then disable make dist.
121+
AS_IF([test $internal_pmix_happy != 1],
122+
[OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PMIX"])])
110123
111124
# unless internal specifically requested by the user, try to find
112125
# an external that works.

0 commit comments

Comments
 (0)