- Implement correct Fortran Logical-handling in f77/f90 interface in
case of:
sizeof(MPI_Flogical) != sizeof (int)
and
Fortran value of .TRUE. != 1
as is often the case.
- Check in configure the value of .TRUE., the C-type coresponding to
logical and check, that fortran compiler does not do something strange
with arrays of logicals
- Convert all occurrences of logicals in the fortran wrappers, only
in case it is needed.
*Please note* Implementation of MPI_Cart_sub needed special treatment.
- Output these value in ompi_info -a
- Clean up the prototypes_mpi.h to just have a single definition and
thereby deleting the necessity for prototypes_pmpi.h
- configured, compiled and tested with F90-program, which uses
MPI_Cart_create and MPI_Cart_get:
linux ia32, gcc (no testing, as no f90)
linux ia32, gcc --disable-mpi-f77 --disable-mpi-f90 (had a bug there)
linux ia32, icc-8.1
linux opteron, gcc-3.3.5, pgcc, pathccx/pathf90 (tested just
pgi-compiler)
linux em64t, gcc, icc-8.1 (tested just icc)
This commit was SVN r8254.
2005-11-24 19:52:35 +03:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2006-01-13 07:08:40 +03:00
|
|
|
# OMPI_F77_GET_VALUE_TRUE()
|
|
|
|
# -------------------------------------------------------
|
|
|
|
# Determine the value of .TRUE. of this FORTRAN compiler.
|
|
|
|
AC_DEFUN([OMPI_F77_GET_VALUE_TRUE],[
|
2006-02-12 19:59:56 +03:00
|
|
|
# invalidate cache if result came from a run where F77 was disabled
|
|
|
|
if test "$ompi_cv_f77_true_value" = "0" ; then
|
|
|
|
unset ompi_cv_f77_true_value
|
|
|
|
fi
|
|
|
|
|
2006-01-13 07:08:40 +03:00
|
|
|
AC_CACHE_CHECK([FORTRAN value for .TRUE. logical type],
|
|
|
|
[ompi_cv_f77_true_value],
|
|
|
|
[if test "$1" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0" ; then
|
|
|
|
ompi_cv_f77_true_value=0
|
|
|
|
else
|
|
|
|
OMPI_F77_MAKE_C_FUNCTION([ompi_print_logical_fn], [print])
|
|
|
|
|
|
|
|
#
|
|
|
|
# C module
|
|
|
|
# We really need the confdefs.h Header file for
|
|
|
|
# the ompi_fortran_logical_t definition
|
|
|
|
#
|
|
|
|
if test \! -f confdefs.h ; then
|
|
|
|
AC_MSG_WARN([*** Problem running configure test!])
|
|
|
|
AC_MSG_WARN([*** Cannot find confdefs.h file for config test])
|
|
|
|
AC_MSG_WARN([*** See config.log for details.])
|
|
|
|
AC_MSG_ERROR([*** Cannot continue.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat > conftest.c <<EOF
|
2005-11-28 19:26:00 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "confdefs.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2006-01-13 07:08:40 +03:00
|
|
|
void $ompi_print_logical_fn(ompi_fortran_logical_t * logical);
|
2005-11-28 19:26:00 +03:00
|
|
|
|
2006-01-13 07:08:40 +03:00
|
|
|
void $ompi_print_logical_fn(ompi_fortran_logical_t * logical)
|
2005-11-28 19:26:00 +03:00
|
|
|
{
|
|
|
|
int result = 0;
|
|
|
|
FILE *f=fopen("conftestval", "w");
|
|
|
|
if (!f) exit(1);
|
|
|
|
|
2005-11-29 09:35:46 +03:00
|
|
|
if( SIZEOF_INT >= sizeof(ompi_fortran_logical_t) ) {
|
2005-11-28 19:26:00 +03:00
|
|
|
fprintf(f, "%d\n", (int)*logical);
|
|
|
|
} else {
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
EOF
|
|
|
|
|
2006-01-13 07:08:40 +03:00
|
|
|
cat > conftestf.f <<EOF
|
- Implement correct Fortran Logical-handling in f77/f90 interface in
case of:
sizeof(MPI_Flogical) != sizeof (int)
and
Fortran value of .TRUE. != 1
as is often the case.
- Check in configure the value of .TRUE., the C-type coresponding to
logical and check, that fortran compiler does not do something strange
with arrays of logicals
- Convert all occurrences of logicals in the fortran wrappers, only
in case it is needed.
*Please note* Implementation of MPI_Cart_sub needed special treatment.
- Output these value in ompi_info -a
- Clean up the prototypes_mpi.h to just have a single definition and
thereby deleting the necessity for prototypes_pmpi.h
- configured, compiled and tested with F90-program, which uses
MPI_Cart_create and MPI_Cart_get:
linux ia32, gcc (no testing, as no f90)
linux ia32, gcc --disable-mpi-f77 --disable-mpi-f90 (had a bug there)
linux ia32, icc-8.1
linux opteron, gcc-3.3.5, pgcc, pathccx/pathf90 (tested just
pgi-compiler)
linux em64t, gcc, icc-8.1 (tested just icc)
This commit was SVN r8254.
2005-11-24 19:52:35 +03:00
|
|
|
program main
|
|
|
|
logical value
|
|
|
|
value=.TRUE.
|
2006-03-24 05:34:13 +03:00
|
|
|
CALL print(value)
|
- Implement correct Fortran Logical-handling in f77/f90 interface in
case of:
sizeof(MPI_Flogical) != sizeof (int)
and
Fortran value of .TRUE. != 1
as is often the case.
- Check in configure the value of .TRUE., the C-type coresponding to
logical and check, that fortran compiler does not do something strange
with arrays of logicals
- Convert all occurrences of logicals in the fortran wrappers, only
in case it is needed.
*Please note* Implementation of MPI_Cart_sub needed special treatment.
- Output these value in ompi_info -a
- Clean up the prototypes_mpi.h to just have a single definition and
thereby deleting the necessity for prototypes_pmpi.h
- configured, compiled and tested with F90-program, which uses
MPI_Cart_create and MPI_Cart_get:
linux ia32, gcc (no testing, as no f90)
linux ia32, gcc --disable-mpi-f77 --disable-mpi-f90 (had a bug there)
linux ia32, icc-8.1
linux opteron, gcc-3.3.5, pgcc, pathccx/pathf90 (tested just
pgi-compiler)
linux em64t, gcc, icc-8.1 (tested just icc)
This commit was SVN r8254.
2005-11-24 19:52:35 +03:00
|
|
|
end
|
|
|
|
EOF
|
|
|
|
|
2006-01-13 07:08:40 +03:00
|
|
|
#
|
|
|
|
# Try the compilation and run.
|
|
|
|
#
|
|
|
|
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
|
|
|
[OMPI_LOG_COMMAND([$F77 $FFLAGS -o conftest conftest.o conftestf.f $LDFLAGS $LIBS],
|
|
|
|
[happy=1], [happy=0])],
|
|
|
|
[happy=0])
|
|
|
|
|
|
|
|
if test "$happy" = "0" ; then
|
|
|
|
AC_MSG_ERROR([Could not determine value of Fotran .TRUE.. Aborting.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AS_IF([test "$cross_compiling" = "yes"],
|
|
|
|
[AC_MSG_ERROR([Can not determine value of .TRUE. when cross-compiling])],
|
|
|
|
[OMPI_LOG_COMMAND([./conftest],
|
|
|
|
[ompi_cv_f77_true_value=`sed 's/ *//' conftestval`],
|
|
|
|
[AC_MSG_ERROR([Could not determine value of Fotran .TRUE.. Aborting.])])])
|
|
|
|
fi])
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_VALUE_TRUE],
|
|
|
|
[$ompi_cv_f77_true_value],
|
|
|
|
[Fortran value for LOGICAL .TRUE. value])
|
|
|
|
|
|
|
|
unset happy ompi_print_logical_fn
|
|
|
|
/bin/rm -f conftest*
|
2005-11-28 19:26:00 +03:00
|
|
|
])dnl
|