@@ -77,15 +77,40 @@ OPAL_MAKEDIST_DISABLE=""
7777# Start it up
7878#
7979
80+ . $srcdir /VERSION
8081OPAL_CONFIGURE_SETUP
8182opal_show_title " Configuring project_name_long"
8283opal_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+
8492AC_PROG_SED
8593
8694AC_CHECK_PROG([PERL],[perl],[perl],[no])
8795AS_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
157181m4_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
207231opal_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-
216233AC_MSG_NOTICE([builddir: $OMPI_TOP_BUILDDIR ])
217234AC_MSG_NOTICE([srcdir: $OMPI_TOP_SRCDIR ])
218235if test " $OMPI_TOP_BUILDDIR " ! = " $OMPI_TOP_SRCDIR " ; then
0 commit comments