diff --git a/acinclude.m4 b/acinclude.m4 index c369923525..4b57dd90e7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -42,6 +42,7 @@ sinclude(config/f90_get_alignment.m4) sinclude(config/f90_get_precision.m4) sinclude(config/f90_get_range.m4) sinclude(config/f90_get_sizeof.m4) +sinclude(config/f90_get_int_kind.m4) m4_sinclude(config/ompi_objc.m4) diff --git a/configure.ac b/configure.ac index 28122d9487..ee778ea423 100644 --- a/configure.ac +++ b/configure.ac @@ -591,6 +591,9 @@ OMPI_RANGE_F90_COMPLEX8=0 OMPI_RANGE_F90_COMPLEX16=0 OMPI_RANGE_F90_COMPLEX32=0 +OMPI_MPI_OFFSET_KIND=0 +OMPI_MPI_ADDRESS_KIND=0 + # # lists of supported Fortran types # @@ -770,6 +773,31 @@ else OMPI_F90_GET_SIZEOF(complex(kind(1.D0)), OMPI_SIZEOF_F90_DBLCOMPLEX) OMPI_F90_GET_ALIGNMENT(complex(kind(1.D0)), OMPI_ALIGNMENT_F90_DBLCOMPLEX) + + # + # get values for Fortran MPI_OFFSET_KIND and MPI_ADDRESS_KIND + # + + OMPI_F90_GET_INT_KIND(18, OMPI_MPI_OFFSET_KIND) + + # + # I believe the AC_CHECK_SIZEOF(void *) is an error + # as the following MUST be run to get ac_cv_sizeof_voidp defined + # + AC_CHECK_SIZEOF(void*) + + if test "$ac_cv_sizeof_voidp" = "2"; then + OMPI_F90_GET_INT_KIND(4, OMPI_MPI_ADDRESS_KIND) + fi + if test "$ac_cv_sizeof_voidp" = "4"; then + OMPI_F90_GET_INT_KIND(9, OMPI_MPI_ADDRESS_KIND) + fi + if test "$ac_cv_sizeof_voidp" = "8"; then + OMPI_F90_GET_INT_KIND(18, OMPI_MPI_ADDRESS_KIND) + fi + if test "$ac_cv_sizeof_voidp" = "16"; then + OMPI_F90_GET_INT_KIND(19, OMPI_MPI_ADDRESS_KIND) + fi fi # @@ -865,6 +893,9 @@ AC_SUBST(OMPI_SIZEOF_F90_COMPLEX8) AC_SUBST(OMPI_SIZEOF_F90_COMPLEX16) AC_SUBST(OMPI_SIZEOF_F90_COMPLEX32) +AC_SUBST(OMPI_MPI_OFFSET_KIND) +AC_SUBST(OMPI_MPI_ADDRESS_KIND) + AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_INTEGER1, $OMPI_HAVE_F90_INTEGER1, [support for fortran integer*1]) AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_INTEGER2, $OMPI_HAVE_F90_INTEGER2, diff --git a/include/mpif.h.in b/include/mpif.h.in index 7d6eb605a5..af8f32aa24 100644 --- a/include/mpif.h.in +++ b/include/mpif.h.in @@ -70,6 +70,12 @@ parameter (MPI_VERSION=2) parameter (MPI_SUBVERSION=0) ! +! kind parameters +! + integer MPI_OFFSET_KIND, MPI_ADDRESS_KIND + parameter (MPI_OFFSET_KIND=@OMPI_MPI_OFFSET_KIND@) + parameter (MPI_ADDRESS_KIND=@OMPI_MPI_ADDRESS_KIND@) +! ! misc. constants ! integer MPI_ANY_SOURCE, MPI_ANY_TAG