Skip to content
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

MPI extension using use-mpi-f08 build fails with "Can't open module" error #3605

Closed
t-kurita opened this issue May 30, 2017 · 7 comments
Closed

Comments

@t-kurita
Copy link
Contributor

Thank you for taking the time to submit an issue!

Background information

What version of Open MPI are you using? (e.g., v1.10.3, v2.1.0, git branch name and hash, etc.)

master branch

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

from a source

Please describe the system on which you are running

  • Complier
    GCC(gfortran) 5.3.0

Details of the problem

I'm making an MPI extension using use-mpi-f08 referring to the example ("ompi/mpiext/example" directory).

When I try to build, the build fails with

Fatal Error: Can't open module file 'mpi_f08_types.mod' for reading at (1): No such file or directory

Even if I use the MPI extension example(ompi/mpiext/example) on master branch, the build fails with the same error.

../../../../../../../src/ompi/mpiext/example/use-mpi-f08/mpiext_example_progress_f08.F90:18:8:

   use :: mpi_f08_types, only : MPI_Comm
        1
Fatal Error: Can't open module file 'mpi_f08_types.mod' for reading at (1): No such file or directory

When I built the MPI extension example, I removed the ompi/mpiext/example/.opal_ignore file.

Is there any counter-measure?

@ggouaillardet
Copy link
Contributor

@t-kurita there is an egg and the chicken issue.
as a temporary workaround, you can

make # this will fail
pushd ompi/mpi/fortran/use-mpi-f08
make
popd
make #this will work but generate an incomplete f08 lib
pushd ompi/mpi/fortran/use-mpi-f08
make clean
popd
make install

before that, you need to manually apply the following patch

diff --git a/ompi/mpiext/example/.opal_ignore b/ompi/mpiext/example/.opal_ignore
deleted file mode 100644
index e69de29..0000000
diff --git a/ompi/mpiext/example/use-mpi-f08/Makefile.am b/ompi/mpiext/example/use-mpi-f08/Makefile.am
index 656a036..fb5a68d 100644
--- a/ompi/mpiext/example/use-mpi-f08/Makefile.am
+++ b/ompi/mpiext/example/use-mpi-f08/Makefile.am
@@ -1,5 +1,7 @@
 #
 # Copyright (c) 2011-2012 Cisco Systems, Inc.  All rights reserved.
+# Copyright (c) 2017      Research Organization for Information Science
+#                         and Technology (RIST). All rights reserved.
 # $COPYRIGHT$
 #
 # Additional copyrights may follow
@@ -12,7 +14,7 @@
 
 # We must set these #defines and include paths so that the inner OMPI
 # MPI prototype header files do the Right Thing.
-AM_FCFLAGS = $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
+AM_FCFLAGS = $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPIF08_DIR) \
              -I$(top_srcdir) $(FCFLAGS_f90)
 
 # Note that the mpi_f08-based bindings are optional -- they can only

and then you have to run (with recent autotools)
./autogen.pl

ggouaillardet added a commit to ggouaillardet/ompi that referenced this issue May 31, 2017
in order to solve an egg and the chicken problem,  in which mpiext need mpi-f08-types.mod
and/but use-mpi-f08[-desc] needs mpiext, add an extra step
- build fortran 2008 modules only
- build fortran 2008 mpi extensions
- and then build fortran 2008 bindings

Fixes open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
ggouaillardet added a commit to ggouaillardet/ompi that referenced this issue May 31, 2017
in order to solve an egg and the chicken problem,  in which mpiext need mpi-f08-types.mod
and/but use-mpi-f08[-desc] needs mpiext, add an extra step
- build fortran 2008 modules only
- build fortran 2008 mpi extensions
- and then build fortran 2008 bindings

Fixes open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
@t-kurita
Copy link
Contributor Author

t-kurita commented Jun 2, 2017

@ggouaillardet thank for your workaround and patch.

I tried it, but build failed with another error

../src/ompi/mpiext/example/use-mpi-f08/mpiext_example_usempif08.h:23:14: Fatal Error: Can't open module file 'mpi_f08_types.mod' for reading at (1): No such file or directory
compilation terminated.

So I modified ompi/mpi/fortran/mpiext/Makefile.am like the following patch, then build was ok.

diff --git a/ompi/mpi/fortran/mpiext/Makefile.am b/ompi/mpi/fortran/mpiext/Makefile.am
index 542e7d4..deae309 100644
--- a/ompi/mpi/fortran/mpiext/Makefile.am
+++ b/ompi/mpi/fortran/mpiext/Makefile.am
@@ -18,6 +18,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
 
 AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
              $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
+             $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPIF08_DIR) \
              -I$(top_srcdir) $(FCFLAGS_f90)
 
 flibs =

@ggouaillardet
Copy link
Contributor

thanks for the feedback.
i made #3617 to fix this issue once for all, and it is pending for review.
you also have the option to manually apply https://github.com/open-mpi/ompi/pull/3617.patch and you will be able to make in one step.
note you need recent autotools if you choose to apply #3617

@t-kurita
Copy link
Contributor Author

t-kurita commented Jun 2, 2017

thank you for reply.
I'll try your patch.

@t-kurita
Copy link
Contributor Author

@ggouaillardet I manually applied your patch https://github.com/open-mpi/ompi/pull/3617.patch.

Then I could make in one step.

Build for MPI extension example ompi/mpiext/example and my MPI extension using use-mpi-f08 were OK.

jsquyres pushed a commit to jsquyres/ompi that referenced this issue Aug 10, 2017
in order to solve an egg and the chicken problem,  in which mpiext need mpi-f08-types.mod
and/but use-mpi-f08[-desc] needs mpiext, add an extra step
- build fortran 2008 modules only
- build fortran 2008 mpi extensions
- and then build fortran 2008 bindings

Fixes open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
(cherry picked from commit 2c71c27)
jsquyres pushed a commit to jsquyres/ompi that referenced this issue Aug 25, 2017
in order to solve an egg and the chicken problem,  in which mpiext need mpi-f08-types.mod
and/but use-mpi-f08[-desc] needs mpiext, add an extra step
- build fortran 2008 modules only
- build fortran 2008 mpi extensions
- and then build fortran 2008 bindings

Fixes open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
(cherry picked from commit 2c71c27)
@nathanweeks
Copy link
Contributor

I still see this error for the Fortran 2008 extension I'm attempting to build. I'm trying to follow the example in ompi/mpi/fortran/mpiext/use-mpi-f08 where the Makefile.am references OMPI_FORTRAN_USEMPIF08_MOD; however, that macro was removed from config/ompi_setup_mpi_fortran.m4 as part of 791bcee.

ggouaillardet added a commit to ggouaillardet/ompi that referenced this issue Dec 11, 2017
OMPI_FORTRAN_USEMPIF08_MOD macro was removed in open-mpi/ompi@791bcee
so this macro is now manually expanded to mpi/fortran/use-mpi-f08/mod

Thanks to Nathan T. Weeks for reporting

Refs open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
ggouaillardet added a commit to ggouaillardet/ompi that referenced this issue Dec 11, 2017
OMPI_FORTRAN_USEMPIF08_MOD macro was removed in open-mpi/ompi@791bcee
so this macro is now manually expanded to mpi/fortran/use-mpi-f08/mod

Thanks to Nathan T. Weeks for reporting

Refs open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>

(cherry picked from commit open-mpi/ompi@794cc09)
ggouaillardet added a commit to ggouaillardet/ompi that referenced this issue Dec 11, 2017
OMPI_FORTRAN_USEMPIF08_MOD macro was removed in open-mpi/ompi@791bcee
so this macro is now manually expanded to mpi/fortran/use-mpi-f08/mod

Thanks to Nathan T. Weeks for reporting

Refs open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>

(cherry picked from commit open-mpi/ompi@794cc09)
@jsquyres
Copy link
Member

@nathanweeks Should now be fixed on master. Let us know if you're still having the problem.

bwbarrett pushed a commit that referenced this issue Dec 14, 2017
OMPI_FORTRAN_USEMPIF08_MOD macro was removed in 791bcee
so this macro is now manually expanded to mpi/fortran/use-mpi-f08/mod

Thanks to Nathan T. Weeks for reporting

Refs #3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>

(cherry picked from commit 794cc09)
bwbarrett pushed a commit that referenced this issue Dec 14, 2017
OMPI_FORTRAN_USEMPIF08_MOD macro was removed in 791bcee
so this macro is now manually expanded to mpi/fortran/use-mpi-f08/mod

Thanks to Nathan T. Weeks for reporting

Refs #3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>

(cherry picked from commit 794cc09)
davideberius pushed a commit to davideberius/ompi that referenced this issue Dec 14, 2017
OMPI_FORTRAN_USEMPIF08_MOD macro was removed in open-mpi/ompi@791bcee
so this macro is now manually expanded to mpi/fortran/use-mpi-f08/mod

Thanks to Nathan T. Weeks for reporting

Refs open-mpi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants