Skip to content

Commit 352b667

Browse files
authored
Merge pull request #6210 from kawashima-fj/pr/mpiext-use-mod
Use mpi_f08 module in mpi_f08_ext module
2 parents e67133c + b380dd5 commit 352b667

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

config/ompi_ext.m4

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ EOF
171171
#include "ompi/mpi/fortran/configure-fortran-output.h"
172172
173173
module mpi_ext
174+
! Some mpi_ext extensions may require the mpi module.
175+
use mpi
176+
!
174177
! Even though this is not a useful parameter (cannot be used as a
175178
! preprocessor catch) define it to keep the linker from complaining
176179
! during the build.
@@ -213,6 +216,9 @@ EOF
213216
#include "ompi/mpi/fortran/configure-fortran-output.h"
214217
215218
module mpi_f08_ext
219+
! Some mpi_f08_ext extensions may require the mpi_f08 module.
220+
use mpi_f08
221+
!
216222
! Even though this is not a useful parameter (cannot be used as a
217223
! preprocessor catch) define it to keep the linker from complaining
218224
! during the build.
@@ -601,9 +607,15 @@ EOF
601607
#
602608
# Include the mpif.h header if it is available. Cannot do
603609
# this from inside the usempi.h since, for VPATH builds, the
604-
# srcdir is needed to find the header.
610+
# srcdir is needed to find the header. Each extension can
611+
# refuse it by defining the OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPI
612+
# macro in its ompi/mpiext/*/configure.m4. See
613+
# ompi/mpiext/example/configure.m4 for an example.
605614
#
606-
if test "$enabled_mpifh" = 1; then
615+
m4_ifdef([OMPI_MPIEXT_]$1[_INCLUDE_MPIFH_IN_USEMPI],
616+
[include_mpifh=OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPI],
617+
[include_mpifh=1])
618+
if test "$enabled_mpifh" = 1 && test "$include_mpifh" != 0; then
607619
mpifh_component_header="mpiext_${component}_mpifh.h"
608620
cat >> $mpiusempi_ext_h <<EOF
609621
#include "${mpifh_component_header_path}"
@@ -657,9 +669,15 @@ EOF
657669
#
658670
# Include the mpif.h header if it is available. Cannot do
659671
# this from inside the usempif08.h since, for VPATH builds,
660-
# the srcdir is needed to find the header.
672+
# the srcdir is needed to find the header. Each extension can
673+
# refuse it by defining the OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPIF08
674+
# macro in its ompi/mpiext/*/configure.m4. See
675+
# ompi/mpiext/example/configure.m4 for an example.
661676
#
662-
if test "$enabled_mpifh" = 1; then
677+
m4_ifdef([OMPI_MPIEXT_]$1[_INCLUDE_MPIFH_IN_USEMPIF08],
678+
[include_mpifh=OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPIF08],
679+
[include_mpifh=1])
680+
if test "$enabled_mpifh" = 1 && test "$include_mpifh" != 0; then
663681
mpifh_component_header="mpiext_${component}_mpifh.h"
664682
cat >> $mpiusempif08_ext_h <<EOF
665683
#include "${mpifh_component_header_path}"

ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
2222
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
2323
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
2424
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08/mod \
25+
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08 \
2526
-I$(top_srcdir) $(FCFLAGS_f90)
2627

2728
flibs =

ompi/mpi/fortran/mpiext-use-mpi/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
2121

2222
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
2323
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
24+
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-ignore-tkr \
2425
-I$(top_srcdir) $(FCFLAGS_f90)
2526

2627
flibs =

ompi/mpiext/example/configure.m4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ AC_DEFUN([OMPI_MPIEXT_example_CONFIG],[
3232

3333
# only need to set this if the component needs init/finalize hooks
3434
AC_DEFUN([OMPI_MPIEXT_example_NEED_INIT], [1])
35+
36+
# By default, mpiext_example_mpifh.h is included in the source file
37+
# of the mpi_ext module. To disable it, define this macro as 0.
38+
#AC_DEFUN([OMPI_MPIEXT_example_INCLUDE_MPIFH_IN_USEMPI], [0])
39+
40+
# By default, mpiext_example_mpifh.h is included in the source file
41+
# of the mpi_f08_ext module. To disable it, define this macro as 0.
42+
#AC_DEFUN([OMPI_MPIEXT_example_INCLUDE_MPIFH_IN_USEMPIF08], [0])

0 commit comments

Comments
 (0)