Skip to content

Commit e9f654b

Browse files
authored
Merge pull request #1 from uofl-capstone-open-mpi/alexsisk/refactor-prrte-config-option
Refactored the --with-prrte configure option to reject building Open MPI against external installs of PRRTE
2 parents a9a89d3 + a8e87f7 commit e9f654b

File tree

2 files changed

+42
-109
lines changed

2 files changed

+42
-109
lines changed

.github/workflows/hdf5-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Build Open MPI
1717
run: |
1818
./autogen.pl
19-
./configure --prefix=/opt/openmpi --with-pmix=internal --with-prrte=internal --with-hwloc=internal --with-libevent=internal --disable-mpi-fortran --disable-oshmem
19+
./configure --prefix=/opt/openmpi --with-pmix=internal --with-hwloc=internal --with-libevent=internal --disable-mpi-fortran --disable-oshmem
2020
make -j 8 && make install
2121
- name: Install HDF5
2222
run: |

config/ompi_setup_prrte.m4

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

0 commit comments

Comments
 (0)