Skip to content

Commit e58f528

Browse files
alexandria-siskhppritcha
authored andcommitted
Refactored --with-prrte configure option to no longer support external PRRTE builds
Signed-off-by: Alexandria Sisk <[email protected]>
1 parent a26f28a commit e58f528

File tree

1 file changed

+40
-107
lines changed

1 file changed

+40
-107
lines changed

config/ompi_setup_prrte.m4

Lines changed: 40 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dnl results of the build.
3939
AC_DEFUN([OMPI_SETUP_PRRTE],[
4040
AC_REQUIRE([AC_PROG_LN_S])
4141
42-
OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy target_rst_dir])
42+
OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy target_rst_dir])
4343
4444
opal_show_subtitle "Configuring PRRTE"
4545
@@ -56,16 +56,34 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
5656
rm -rf "$target_rst_dir/prrte-rst-content"
5757
rm -rf "$target_rst_dir/schizo-ompi-rst-content"
5858
59-
OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1])
59+
AC_ARG_WITH([prrte],
60+
[AS_HELP_STRING([--with-prrte],
61+
[Enable/disable building with PRRTE. Supports 'yes' and 'no', defaulting to 'yes'])])
62+
63+
# We only want to accept 'yes' or 'no' as args for --with-prrte.
64+
# If user does not specify, it defaults to 'yes'.
65+
# We no longer support external prrte builds.
66+
prrte_setup_internal_happy=0
67+
AS_IF([test "$with_prrte" != "yes" -a "$with_prrte" != "no" -a "$with_prrte" != ""],
68+
AC_MSG_ERROR(["--with-prrte option defaults to 'yes' and supports 'yes' or 'no'. External PRRTE builds are no longer supported.]))
6069
6170
AC_ARG_WITH([prrte-bindir],
6271
[AS_HELP_STRING([--with-prrte-bindir=DIR],
6372
[Search for PRRTE binaries in DIR. Defaults to PRRTE_DIR/bin if not specified])])
73+
74+
# Determines if user wants to build with PRRTE.
75+
# Defaults to building with PRRTE if unspecified.
76+
AS_CASE([$with_prrte],
77+
["yes"], [prrte_setup_internal_happy=1
78+
opal_prrte_mode="internal"],
79+
["no"], [prrte_setup_internal_happy=0
80+
opal_prrte_mode="disabled"],
81+
[""], [prrte_setup_internal_happy=1
82+
opal_prrte_mode="internal"])
6483
65-
prrte_setup_internal_happy=0
6684
m4_ifdef([package_prrte],
6785
[OMPI_PRRTE_ADD_ARGS
68-
AS_IF([test "$opal_prrte_mode" = "unspecified" -o "$opal_prrte_mode" = "internal"],
86+
AS_IF([test "$opal_prrte_mode" = "internal"],
6987
[# Run PRRTE's configure script unless the user
7088
# explicitly asked us to use an external PMIX, so that
7189
# "make dist" includes PRRTE in the dist tarball. This
@@ -78,37 +96,26 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
7896
_OMPI_SETUP_PRRTE_INTERNAL([prrte_setup_internal_happy=1],
7997
[prrte_setup_internal_happy=0])])
8098
81-
# if we have a pmix package and configure did not complete
82-
# successfully (or wasn't started), then disable make dist.
83-
AS_IF([test $prrte_setup_internal_happy != 1],
84-
[OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PRRTE"])])
85-
86-
# unless internal specifically requested by the user, try to find
87-
# an external that works.
88-
prrte_setup_external_happy=0
89-
AS_IF([test "$opal_prrte_mode" != "internal" -a "$opal_prrte_mode" != "disabled"],
90-
[_OMPI_SETUP_PRRTE_EXTERNAL(
91-
[prrte_setup_external_happy=1
92-
opal_prrte_mode="external"],
93-
[AS_IF([test "$opal_prrte_mode" = "external"],
94-
[AC_MSG_ERROR([External PRRTE requested but not found.])])])])
95-
96-
# external did not work out and customer did not specify external,
97-
# so try the internal version.
98-
AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "1"],
99-
[opal_prrte_mode="internal"
100-
OMPI_USING_INTERNAL_PRRTE=1
101-
_OMPI_SETUP_PRRTE_INTERNAL_POST()],
102-
[OMPI_USING_INTERNAL_PRRTE=0])
103-
104-
AS_IF([test "$opal_prrte_mode" != "disabled"],
105-
[AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "0"],
106-
[AC_MSG_ERROR([Could not find viable prrte build.])])
107-
OMPI_HAVE_PRRTE=1],
108-
[OMPI_HAVE_PRRTE=0])
99+
# if we have a pmix package and configure did not complete
100+
# successfully (or wasn't started), then disable make dist.
101+
AS_IF([test $prrte_setup_internal_happy != 1],
102+
[OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PRRTE"])])
103+
104+
AS_IF([test "$opal_prrte_mode" = "disabled"],
105+
[OMPI_WANT_PRRTE=0
106+
OMPI_HAVE_PRRTE=0
107+
OMPI_USING_INTERNAL_PRRTE=0
108+
OMPI_HAVE_PRRTE_RST=0],
109+
[AS_IF([test "$prrte_setup_internal_happy" = "1"],
110+
[OMPI_WANT_PRRTE=1
111+
OMPI_HAVE_PRRTE=1
112+
OMPI_USING_INTERNAL_PRRTE=1
113+
_OMPI_SETUP_PRRTE_INTERNAL_POST()],
114+
[OMPI_HAVE_PRRTE=0
115+
OMPI_USING_INTERNAL_PRRTE=0])])
109116
110117
AM_CONDITIONAL([OMPI_WANT_PRRTE],
111-
[test "$prrte_setup_internal_happy" = "1" -o "$prrte_setup_external_happy" = "1"])
118+
[test "$prrte_setup_internal_happy" = "1"])
112119
113120
AC_DEFINE_UNQUOTED([OMPI_HAVE_PRRTE],
114121
[$OMPI_HAVE_PRRTE],
@@ -265,77 +272,3 @@ dnl succeeded.
265272
AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL_POST], [
266273
OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS prrte"
267274
])
268-
269-
270-
dnl _OMPI_SETUP_PRRTE_EXTERNAL([action if success], [action if not success])
271-
dnl
272-
dnl Try to find an external prrte with sufficient version.
273-
AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [
274-
OPAL_VAR_SCOPE_PUSH([ompi_prte_min_version ompi_prte_min_num_version setup_prrte_external_happy opal_prrte_CPPFLAGS_save])
275-
276-
opal_prrte_CPPFLAGS_save=$CPPFLAGS
277-
278-
AS_IF([test -n "${with_prrte}" -a "${with_prrte}" != "yes" -a "${with_prrte}" != "no"],
279-
[OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], ["-I${with_prrte}/include"])])
280-
281-
AC_CHECK_HEADER([prte.h], [setup_prrte_external_happy=yes],
282-
[setup_prrte_external_happy=no])
283-
284-
ompi_prte_min_version=OMPI_PRTE_MIN_VERSION
285-
ompi_prte_min_num_version=OMPI_PRTE_NUMERIC_MIN_VERSION
286-
AS_IF([test "${setup_prrte_external_happy}" = "yes"],
287-
[AC_CACHE_CHECK([if external PRRTE version is OMPI_PRTE_MIN_VERSION or greater],
288-
[ompi_setup_prrte_cv_version_happy],
289-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <prte_version.h>
290-
]], [[
291-
#if PRTE_NUMERIC_VERSION < $ompi_prte_min_num_version
292-
#error "prrte API version is less than $ompi_prte_min_version"
293-
#endif
294-
]])],
295-
[ompi_setup_prrte_cv_version_happy="yes"],
296-
[ompi_setup_prrte_cv_version_happy="no"])])
297-
AS_IF([test "${ompi_setup_prrte_cv_version_happy}" = "no"],
298-
[setup_prrte_external_happy="no"])])
299-
300-
CPPFLAGS="$opal_prrte_CPPFLAGS_save"
301-
302-
# If an external build and the user told us where to find PRRTE,
303-
# find prterun and save that path.
304-
prterun_path=
305-
AS_IF([test "$setup_prrte_external_happy" = "yes"],
306-
[AS_IF([test "${with_prrte_bindir}" = "yes" -o "${with_prrte_bindir}" = "no"],
307-
[AC_MSG_ERROR(["yes" and "no" are not valid arguments for --with-prrte-bindir])])
308-
AS_IF([test -z "${with_prrte_bindir}" -a -n "${with_prrte}"],
309-
[with_prrte_bindir="${with_prrte}/bin"])
310-
AS_IF([test -n "${with_prrte_bindir}"],
311-
[AS_IF([test -x ${with_prrte_bindir}/prterun],
312-
[prterun_path="${with_prrte_bindir}/prterun"],
313-
[AC_MSG_ERROR([Could not find executable prterun: ${with_prrte_bindir}/prterun])])])])
314-
AS_IF([test -n "${prterun_path}"],
315-
[AC_DEFINE_UNQUOTED([OMPI_PRTERUN_PATH], ["${prterun_path}"], [Path to prterun])])
316-
317-
OMPI_HAVE_PRRTE_RST=0
318-
AS_IF([test "$setup_prrte_external_happy" = "yes"],
319-
[ # Determine if this external PRRTE has installed the RST
320-
# directories that we care about
321-
322-
AC_MSG_CHECKING([for external PRRTE RST files])
323-
prrte_install_dir=${with_prrte}/share/prte/rst
324-
AS_IF([test -n "$SPHINX_BUILD"],
325-
[AS_IF([test -d "$prrte_install_dir/prrte-rst-content" && \
326-
test -d "$prrte_install_dir/schizo-ompi-rst-content"],
327-
[OMPI_HAVE_PRRTE_RST=1
328-
OMPI_PRRTE_RST_CONTENT_DIR="$prrte_install_dir/prrte-rst-content"
329-
OMPI_SCHIZO_OMPI_RST_CONTENT_DIR="$prrte_install_dir/schizo-ompi-rst-content"
330-
AC_MSG_RESULT([found])
331-
],
332-
[ # This version of PRRTE doesn't have installed RST
333-
# files.
334-
AC_MSG_RESULT([not found])
335-
])
336-
])
337-
$1],
338-
[$2])
339-
340-
OPAL_VAR_SCOPE_POP
341-
])

0 commit comments

Comments
 (0)