Skip to content

Commit bb1f6dc

Browse files
authored
Merge pull request #13248 from jsquyres/pr/add-explicit-python-check
Add explicit test for Python >= v3.7 in configure
2 parents 9b06b34 + cb4fe48 commit bb1f6dc

File tree

9 files changed

+75
-25
lines changed

9 files changed

+75
-25
lines changed

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ automake_min_version=1.13.4
3333
autoconf_min_version=2.69.0
3434
libtool_min_version=2.4.2
3535
flex_min_version=2.5.4
36+
python_min_version=3.7
3637

3738
# greek is generally used for alpha or beta release tags. If it is
3839
# non-empty, it will be appended to the version number. It does not

config/ompi_configure_options.m4

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,4 @@ else
252252
ompi_want_ompio=1
253253
fi
254254
AM_CONDITIONAL(OMPI_OMPIO_SUPPORT, test "$ompi_want_ompio" = "1")
255-
256-
# If the binding source files don't exist, then we need Python to generate them
257-
AM_PATH_PYTHON([3.6],,[:])
258-
binding_file="${srcdir}/ompi/mpi/c/ompi_send.c"
259-
AS_IF([! test -e "$binding_file" && test "$PYTHON" = ":"],
260-
[AC_MSG_ERROR([Open MPI requires Python >=3.6 for generating the bindings. Aborting])])
261-
AM_CONDITIONAL(OMPI_GENERATE_BINDINGS,[test "$PYTHON" != ":"])
262-
263255
])dnl
264-

configure.ac

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,40 @@ OPAL_MAKEDIST_DISABLE=""
7777
# Start it up
7878
#
7979

80+
. $srcdir/VERSION
8081
OPAL_CONFIGURE_SETUP
8182
opal_show_title "Configuring project_name_long"
8283
opal_show_subtitle "Prerequisites"
8384

85+
OMPI_TOP_BUILDDIR="`pwd`"
86+
AC_SUBST(OMPI_TOP_BUILDDIR)
87+
cd "$srcdir"
88+
OMPI_TOP_SRCDIR="`pwd`"
89+
AC_SUBST(OMPI_TOP_SRCDIR)
90+
cd "$OMPI_TOP_BUILDDIR"
91+
8492
AC_PROG_SED
8593

8694
AC_CHECK_PROG([PERL],[perl],[perl],[no])
8795
AS_IF([test "X$PERL" = "Xno"],
88-
[AC_MSG_ERROR(["Open MPI requires perl. Aborting"])])
96+
[AC_MSG_ERROR([Open MPI requires perl to build. Aborting.])])
97+
98+
# We need Python if any of these are true:
99+
# - you're building the MPI Fortran bindings
100+
# - you're in a git clone (i.e., not a distribution tarball that has
101+
# already been bootstrapped)
102+
AC_MSG_CHECKING([if we need Python])
103+
AS_IF([test "$enable_mpi_fortran" = "yes"], [need_python=yes],
104+
[test -d "${OMPI_TOP_SRCDIR}/.git"], [need_python=yes],
105+
[need_python=no])
106+
AC_MSG_RESULT([$need_python])
107+
108+
AS_IF([test "$need_python" = "yes"],
109+
[AM_PATH_PYTHON([$python_min_version],
110+
[have_good_python=1],
111+
[AC_MSG_ERROR([Open MPI requires Python >=$python_min_version to build. Aborting.])])],
112+
[have_good_python=0])
113+
AM_CONDITIONAL(OMPI_GENERATE_BINDINGS, [test $have_good_python -eq 1])
89114

90115
#
91116
# Setup some things that must be done before AM-INIT-AUTOMAKE
@@ -153,7 +178,6 @@ OPAL_SAVE_VERSION([OPAL], [Open Portable Access Layer], [$srcdir/VERSION],
153178

154179
# Get shared library version numbers
155180

156-
. $srcdir/VERSION
157181
m4_ifdef([project_ompi],
158182
[AC_SUBST(libmpi_so_version)
159183
AC_SUBST(libmpi_mpifh_so_version)
@@ -206,13 +230,6 @@ m4_ifdef([project_oshmem],
206230

207231
opal_show_subtitle "Initialization, setup"
208232

209-
OMPI_TOP_BUILDDIR="`pwd`"
210-
AC_SUBST(OMPI_TOP_BUILDDIR)
211-
cd "$srcdir"
212-
OMPI_TOP_SRCDIR="`pwd`"
213-
AC_SUBST(OMPI_TOP_SRCDIR)
214-
cd "$OMPI_TOP_BUILDDIR"
215-
216233
AC_MSG_NOTICE([builddir: $OMPI_TOP_BUILDDIR])
217234
AC_MSG_NOTICE([srcdir: $OMPI_TOP_SRCDIR])
218235
if test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"; then

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def get_tarball_version(path, expr):
101101
autoconf_min_version = f"{ompi_data['autoconf_min_version']}"
102102
libtool_min_version = f"{ompi_data['libtool_min_version']}"
103103
flex_min_version = f"{ompi_data['flex_min_version']}"
104+
python_min_version = f"{ompi_data['python_min_version']}"
104105
mpi_standard_major_version = f"{ompi_data['mpi_standard_version']}"
105106
mpi_standard_minor_version = f"{ompi_data['mpi_standard_subversion']}"
106107

@@ -304,6 +305,7 @@ def _doit(topdir):
304305
.. |autoconf_min_version| replace:: {autoconf_min_version}
305306
.. |libtool_min_version| replace:: {libtool_min_version}
306307
.. |flex_min_version| replace:: {flex_min_version}
308+
.. |python_min_version| replace:: {python_min_version}
307309
.. |mpi_standard_version| replace:: {mpi_standard_major_version}.{mpi_standard_minor_version}
308310
.. |mpi_standard_major_version| replace:: {mpi_standard_major_version}
309311
.. |mpi_standard_minor_version| replace:: {mpi_standard_minor_version}

docs/developers/prerequisites.rst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,28 @@ more detail.
5050
Python
5151
------
5252

53-
Python >= v3.6 is required for generating the Fortran bindings, which
54-
is necessary if you build Open MPI from a Git clone.
53+
Python >= |python_min_version| is required for several tasks during
54+
the Open MPI build, such as (but not limited to):
5555

56-
Python is also required for running Sphinx to generate the docs, too
57-
(:ref:`see below <developers-requirements-sphinx-label>`).
56+
* In all cases (including from distribution tarballs):
57+
58+
* Generating Fortran constants and compiler-specific symbols
59+
60+
* When building from a Git clone:
61+
62+
* Generating the Fortran bindings
63+
64+
* Generating the "show help" messages
65+
66+
* Generating bindings in the MPI man pages (via the `pympistandard
67+
module <https://github.com/mpi-forum/pympistandard/>`_) module)
68+
69+
* Building the Open MPI documentation and man pages
70+
71+
All of these are necessary when building from a Git clone. Most of
72+
these can be accomplished with core Python; only building the full
73+
Open MPI documentation and man pages requires additional Python
74+
packages (:ref:`see below <developers-requirements-sphinx-label>`).
5875

5976
Perl
6077
----

docs/developers/sphinx.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Installing Python
1313
-----------------
1414

1515
The `Sphinx tool <https://www.sphinx-doc.org/>`_ is written in Python,
16-
and therefore needs to have Python available. As of late 2022, Sphinx
17-
requires Python >= v3.7.
16+
and therefore needs to have Python available. As of May 2025, Sphinx
17+
|mdash| and Open MPI |mdash| requires Python >= v3.7.
1818

1919
This documentation does not contain detailed instructions for
2020
installing a Python version sufficient for using Sphinx. Consult your

docs/installing-open-mpi/quickstart.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ Download the Open MPI source code from `the main Open MPI web site
6262
They are **not** official Open MPI releases.
6363

6464
Open MPI uses a traditional ``configure`` script paired with ``make``
65-
to build. Typical installs can be of the pattern:
65+
to build. Open MPI requires Perl, and may require Python >=
66+
|python_min_version|, as part of its build process. Typical installs
67+
can be of the pattern:
6668

6769
.. code-block:: sh
6870

docs/installing-open-mpi/supported-systems.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ operating systems that we do not currently support. If we do not have
2828
systems to test these on, we probably will only claim to
2929
"unofficially" support those systems.
3030

31+
Perl and Python
32+
^^^^^^^^^^^^^^^
33+
34+
Open MPI requires Perl while building. If you are building the
35+
Fortran MPI bindings, or if you are building from a Git clone, Open
36+
MPI also requires Python >= |python_min_version| while building.
37+
38+
.. note:: The Open MPI community is slowly converting its Perl scripts
39+
to Python; it is expected (hoped) that we'll someday have no
40+
more Perl in the build process for official distribution
41+
tarballs or Git clones.
42+
3143
Supported Hardware Platforms
3244
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3345

docs/release-notes/changelog/v6.0.x.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@ Open MPI version v6.0.0
99
:Date: ...fill me in...
1010

1111
- Open MPI now requires a C11-compliant compiler to build.
12+
13+
- Open MPI now requires Python >= |python_min_version| to build the
14+
Fortran MPI bindings (or when building from a Git clone).
15+
16+
- Open MPI has always required Perl to build; our Perl scripts are
17+
slowly being converted to Python.
18+
1219
- Removed ROMIO package.
20+
1321
- Added MPI-4.1 ``MPI_Status_*`` functions.

0 commit comments

Comments
 (0)