-
Notifications
You must be signed in to change notification settings - Fork 902
OpenMPI may pick up an old version of mpi.mod from an existing installation for building #7253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What should the Open MPI build do differently, if an I'm open to suggestions. |
In C/C++ there's |
Here are some relevant ifort docs:
However, these do not help if Open-MPI explicitly looks in ifort -DHAVE_CONFIG_H -I. -I../../../../../ompi/mpi/fortran/mpiext-use-mpi \
-I../../../../opal/include -I../../../../ompi/include -I../../../../oshmem/include \
-I../../../../opal/mca/hwloc/hwloc201/hwloc/include/private/autogen \
-I../../../../opal/mca/hwloc/hwloc201/hwloc/include/hwloc/autogen \
-I../../../../ompi/mpiext/cuda/c -I../../../../.. -I../../../.. -I../../../../../opal/include \
-I../../../../../orte/include -I../../../../orte/include -I../../../../../ompi/include \
-I../../../../../oshmem/include -I/Users/jrhammon/Work/MPI/OMPI/github/build/opal/mca/event/libevent2022/libevent/include \
-I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/event/libevent2022/libevent \
-I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/event/libevent2022/libevent/include \
-I/Users/jrhammon/Work/MPI/OMPI/github/build/opal/mca/hwloc/hwloc201/hwloc/include \
-I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/hwloc/hwloc201/hwloc/include \
-I/usr/local/include -I/usr/local/include -I../../../../ompi/include -I../../../../../ompi/include \
-I../../../../ompi/mpi/fortran/base -I../../../../ompi/mpi/fortran/use-mpi-ignore-tkr \
-I../../../../.. -X -c -o mpi-ext-module.lo mpi-ext-module.F90 I do not know why Open-MPI needs to add this include path for Fortran since there is nothing in this folder that should ever be required for compiler Fortran code. All the build-in modules are already known to the Fortran compiler and the third-party modules are, of course, the ones one absolutely should not get from such a path. A solution that may be less intrusive is to place |
@jsquyres In short, Open-MPI should modify CPPFLAGS to not include the system header path when compiling Fortran, or it should not use CPPFLAGS at all and create a new variable like FPPFLAGS that only includes the right paths (ones inside the Open-MPI source tree). |
@jeffhammond A few things:
PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_FCFLAGS) $(FCFLAGS) I wonder why that is...? 🤷♂ @jeffhammond @marmistrz That being said, does this patch obviate the issue for you: diff --git a/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am b/ompi/mpi/fortran/mpiext-use-mpi
index b8318ce93c..9cec237718 100644
--- a/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
+++ b/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
@@ -15,6 +15,9 @@
# the mpi ext modules.
#
+CPPFLAGS =
+AM_CPPFLAGS =
+
if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
# Setup |
@jsquyres That patch fixes this bug. Edit: it might create a new one. Please stand by for details. |
With the patch, I get this error:
|
@jsquyres This fixes the issue. I doubt it is the minimal change solution. diff --git a/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am b/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
index 9cec237718..9585c019c9 100644
--- a/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
+++ b/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
@@ -15,8 +15,8 @@
# the mpi ext modules.
#
-CPPFLAGS =
-AM_CPPFLAGS =
+CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include -I$(top_srcdir)/ompi/include
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include -I$(top_srcdir)/ompi/include
if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
The problem now appears in the MPI F08 module, so a similar solution will need to be applied there. |
I do not understand this one. Input$ git diff master
diff --git a/ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am b/ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am
index 616982611a..084784175e 100644
--- a/ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am
+++ b/ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am
@@ -15,6 +15,9 @@
# the mpi_f08 ext modules.
#
+CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include -I$(top_srcdir)/ompi/include
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include -I$(top_srcdir)/ompi/include
+
if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
# Setup
diff --git a/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am b/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
index b8318ce93c..9585c019c9 100644
--- a/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
+++ b/ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
@@ -15,6 +15,9 @@
# the mpi ext modules.
#
+CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include -I$(top_srcdir)/ompi/include
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include -I$(top_srcdir)/ompi/include
+
if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
# Setup
Output
|
@jeffhammond This is likely the same issue.
fwiw, here is the list of F08 modules generated by Open MPI (and that should be picked under |
I filed a complete PR in #7265 so that we can properly talk about the code without posting a series of diffs. @jeffhammond GitHub Pro Tip: if you put the word |
Background information
What version of Open MPI are you using? (e.g., v1.10.3, v2.1.0, git branch name and hash, etc.)
8b424c3
Please describe the system on which you are running
Details of the problem
OpenMPI was configured as follows:
Then the compilation fails with:
the configuration details printed by
configure
:This happened because there was still a leftover from the previous installation,
/usr/local/include/mpi.mod
. It was picked up bymake
and used for the build of the new version. This is probably a bug, after purging this file the compilation succeeded.The text was updated successfully, but these errors were encountered: