Skip to content

Commit 604dc97

Browse files
committed
ompi_ext.m4: Allow generated MPI-ext Fortran headers
Allow MPI extensions to generate Fortran headers using Autoconf. For example, allow following files. ``` ompi/mpiext/example/mpif-h/mpiext_example_mpifh.h.in ompi/mpiext/example/use-mpi/mpiext_example_usempi.h.in ompi/mpiext/example/use-mpi-f08/mpiext_example_usempif08.h.in ``` Generated MPI extension C headers are already allowed in commit 6a7d527. Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
1 parent 90ae7d4 commit 604dc97

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

config/ompi_ext.m4

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ EOF
506506

507507
AC_MSG_CHECKING([if MPI Extension $component has mpif.h bindings])
508508

509-
if test -e "$test_header" ; then
509+
if test -e "$test_header" || test -e "$test_header".in ; then
510510
AC_MSG_RESULT([yes])
511511
enabled_mpifh=1
512512

@@ -541,6 +541,10 @@ EOF
541541
AC_MSG_ERROR([Cannot continue])])
542542

543543
component_header="mpiext_${component}_mpifh.h"
544+
mpifh_component_header_path="ompi/mpiext/$component/mpif-h/${component_header}"
545+
if test -e "${srcdir}/${mpifh_component_header_path}" ; then
546+
mpifh_component_header_path="${srcdir}/${mpifh_component_header_path}"
547+
fi
544548

545549
cat >> $mpif_ext_h <<EOF
546550
!
@@ -577,12 +581,17 @@ EOF
577581

578582
AC_MSG_CHECKING([if MPI Extension $component has "use mpi" bindings])
579583

580-
if test -e "$test_header" ; then
584+
if test -e "$test_header" || test -e "$test_header".in ; then
581585
AC_MSG_RESULT([yes])
582586

583587
EXT_USEMPI_HEADERS="$EXT_USEMPI_HEADERS mpiext/$component/use-mpi/mpiext_${component}_usempi.h"
584588
$5="$$5 $component"
589+
585590
component_header="mpiext_${component}_usempi.h"
591+
usempi_component_header_path="ompi/mpiext/$component/use-mpi/$component_header"
592+
if test -e "${srcdir}/${usempi_component_header_path}" ; then
593+
usempi_component_header_path="${srcdir}/${usempi_component_header_path}"
594+
fi
586595

587596
cat >> $mpiusempi_ext_h <<EOF
588597
!
@@ -597,12 +606,12 @@ EOF
597606
if test "$enabled_mpifh" = 1; then
598607
mpifh_component_header="mpiext_${component}_mpifh.h"
599608
cat >> $mpiusempi_ext_h <<EOF
600-
#include "${srcdir}/ompi/mpiext/$component/mpif-h/$mpifh_component_header"
609+
#include "${mpifh_component_header_path}"
601610
EOF
602611
fi
603612

604613
cat >> $mpiusempi_ext_h <<EOF
605-
#include "${srcdir}/ompi/mpiext/$component/use-mpi/$component_header"
614+
#include "${usempi_component_header_path}"
606615
607616
EOF
608617
else
@@ -628,13 +637,17 @@ EOF
628637

629638
AC_MSG_CHECKING([if MPI Extension $component has "use mpi_f08" bindings])
630639

631-
if test -e "$test_header" ; then
640+
if test -e "$test_header" || test -e "$test_header".in ; then
632641
AC_MSG_RESULT([yes])
633642

634643
EXT_USEMPIF08_HEADERS="$EXT_USEMPIF08_HEADERS mpiext/$component/use-mpi-f08/mpiext_${component}_usempif08.h"
635644
$6="$$6 $component"
636645

637646
component_header="mpiext_${component}_usempif08.h"
647+
usempif08_component_header_path="ompi/mpiext/$component/use-mpi-f08/$component_header"
648+
if test -e "${srcdir}/${usempif08_component_header_path}" ; then
649+
usempif08_component_header_path="${srcdir}/${usempif08_component_header_path}"
650+
fi
638651

639652
cat >> $mpiusempif08_ext_h <<EOF
640653
!
@@ -649,12 +662,12 @@ EOF
649662
if test "$enabled_mpifh" = 1; then
650663
mpifh_component_header="mpiext_${component}_mpifh.h"
651664
cat >> $mpiusempif08_ext_h <<EOF
652-
#include "${srcdir}/ompi/mpiext/$component/mpif-h/$mpifh_component_header"
665+
#include "${mpifh_component_header_path}"
653666
EOF
654667
fi
655668

656669
cat >> $mpiusempif08_ext_h <<EOF
657-
#include "${srcdir}/ompi/mpiext/$component/use-mpi-f08/$component_header"
670+
#include "${usempif08_component_header_path}"
658671
659672
EOF
660673
else

0 commit comments

Comments
 (0)