From 164e8caa5e8b912d5850bdbf19c4eb61d000f9bb Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Wed, 4 May 2005 18:37:32 +0000 Subject: [PATCH] If the F77 datatype (like INTEGER*1) is supposed to be available, check for the size. If it does not fit, purge from the list, i.e. reset all values to zero. Fixes pgf90 problem, which silently accepts INTEGER*16, but internally using INTEGER... This commit was SVN r5594. --- acinclude.m4 | 1 + config/f77_purge_unsupported_kind.m4 | 34 ++++++++++++++++++++++++++++ configure.ac | 20 ++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 config/f77_purge_unsupported_kind.m4 diff --git a/acinclude.m4 b/acinclude.m4 index 189bfea725..317441bc4a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -33,6 +33,7 @@ sinclude(config/f77_find_ext_symbol_convention.m4) sinclude(config/f77_get_alignment.m4) sinclude(config/f77_get_fortran_handle_max.m4) sinclude(config/f77_get_sizeof.m4) +sinclude(config/f77_purge_unsupported_kind.m4) sinclude(config/f90_check_type.m4) sinclude(config/f90_find_module_include_flag.m4) diff --git a/config/f77_purge_unsupported_kind.m4 b/config/f77_purge_unsupported_kind.m4 new file mode 100644 index 0000000000..3251977007 --- /dev/null +++ b/config/f77_purge_unsupported_kind.m4 @@ -0,0 +1,34 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2004-2005 The Trustees of Indiana University. +dnl All rights reserved. +dnl Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +dnl All rights reserved. +dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +dnl University of Stuttgart. All rights reserved. +dnl Copyright (c) 2004-2005 The Regents of the University of California. +dnl All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +AC_DEFUN([OMPI_F77_PURGE_UNSUPPORTED_KIND],[ +# Purge F77 types (such as INTEGER*16) that don't match exptected datatype size. +# First arg is type, 2nd arg is config var to define. +AC_MSG_CHECKING([whether FORTRAN $1 has expected size]) + + val=`echo $1 | cut -f2 -d'*'` + type=`echo $1 | cut -f1 -d'*'` + if test "x$((OMPI_SIZEOF_FORTRAN_$type$val))" != "x$val" ; then + eval "OMPI_SIZEOF_FORTRAN_$type$val=0" + # eval "OMPI_ALIGNMENT_FORTRAN_$type$val=0" + eval "OMPI_HAVE_FORTRAN_$type$val=0" + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([yes]) + fi + unset val type +])dnl diff --git a/configure.ac b/configure.ac index 499d685ea3..ffa36637d7 100644 --- a/configure.ac +++ b/configure.ac @@ -421,6 +421,26 @@ else OMPI_F77_GET_SIZEOF(COMPLEX, OMPI_SIZEOF_FORTRAN_COMPLEX) OMPI_F77_GET_SIZEOF(DOUBLE COMPLEX, OMPI_SIZEOF_FORTRAN_DBLCOMPLEX) + if test "$OMPI_HAVE_FORTRAN_INTEGER1" = "1"; then + OMPI_F77_GET_SIZEOF(INTEGER*1, OMPI_SIZEOF_FORTRAN_INTEGER1) + OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*1) + fi + if test "$OMPI_HAVE_FORTRAN_INTEGER2" = "1"; then + OMPI_F77_GET_SIZEOF(INTEGER*2, OMPI_SIZEOF_FORTRAN_INTEGER2) + OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*2) + fi + if test "$OMPI_HAVE_FORTRAN_INTEGER4" = "1"; then + OMPI_F77_GET_SIZEOF(INTEGER*4, OMPI_SIZEOF_FORTRAN_INTEGER4) + OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*4) + fi + if test "$OMPI_HAVE_FORTRAN_INTEGER8" = "1"; then + OMPI_F77_GET_SIZEOF(INTEGER*8, OMPI_SIZEOF_FORTRAN_INTEGER8) + OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*8) + fi + if test "$OMPI_HAVE_FORTRAN_INTEGER16" = "1"; then + OMPI_F77_GET_SIZEOF(INTEGER*16, OMPI_SIZEOF_FORTRAN_INTEGER16) + OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*16) + fi OMPI_F77_GET_ALIGNMENT(LOGICAL, OMPI_ALIGNMENT_FORTRAN_LOGICAL) OMPI_F77_GET_ALIGNMENT(INTEGER, OMPI_ALIGNMENT_FORTRAN_INTEGER) OMPI_F77_GET_ALIGNMENT(REAL, OMPI_ALIGNMENT_FORTRAN_REAL)