2004-01-08 16:34:31 +03:00
|
|
|
dnl -*- shell-script -*-
|
|
|
|
dnl
|
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
2004-06-07 19:33:53 +04:00
|
|
|
dnl OMPI_SETUP_F90
|
2004-03-28 14:02:38 +04:00
|
|
|
dnl
|
|
|
|
dnl sets:
|
|
|
|
dnl F90 : full pathname to compiler
|
|
|
|
dnl BASEF90 : compiler name (no path)
|
2004-06-07 19:33:53 +04:00
|
|
|
dnl OMPI_WANT_F90_BINDINGS : (actually set by ompi_configure_options, may be
|
2004-03-28 14:02:38 +04:00
|
|
|
dnl redefined here)
|
|
|
|
dnl FC : Same as F90. Side effect of AC_PROG_FC. Should
|
|
|
|
dnl not be used
|
|
|
|
dnl defines:
|
2004-06-07 19:33:53 +04:00
|
|
|
dnl OMPI_F90 : same as F90
|
|
|
|
dnl OMPI_WANT_F90_BINDINGS :
|
2004-03-28 14:02:38 +04:00
|
|
|
dnl am_conditional:
|
2004-06-07 19:33:53 +04:00
|
|
|
dnl OMPI_WANT_F90_BINDINGS :
|
2004-01-08 16:34:31 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_SETUP_F90],[
|
2004-01-08 16:34:31 +03:00
|
|
|
|
|
|
|
# Modularize this setup so that sub-configure.in scripts can use this
|
|
|
|
# same setup code.
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_show_subtitle "Fortran 90/95 compiler"
|
2004-01-08 16:34:31 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
|
2004-03-28 14:30:36 +04:00
|
|
|
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (Fortran 77 was disabled)])
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_WANT_F90_BINDINGS=0
|
|
|
|
OMPI_F90="none"
|
2004-03-28 14:02:38 +04:00
|
|
|
BASEF90="none"
|
2004-06-07 19:33:53 +04:00
|
|
|
elif test "$OMPI_WANT_F90_BINDINGS" = "0" ; then
|
2004-03-28 14:30:36 +04:00
|
|
|
AC_MSG_WARN([*** Fortran 90/95 bindings disabled by user])
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_WANT_F90_BINDINGS=0
|
|
|
|
OMPI_F90="none"
|
2004-03-28 14:02:38 +04:00
|
|
|
BASEF90="none"
|
2004-01-08 16:34:31 +03:00
|
|
|
else
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check for the compiler
|
|
|
|
#
|
|
|
|
# Note that we don't actually *use* the fortran compiler to build
|
2004-06-07 19:33:53 +04:00
|
|
|
# anything in OMPI; it's only used here in configure to find out
|
2004-01-08 16:34:31 +03:00
|
|
|
# symbol conventions, type sizes, etc. We also pass it down to
|
|
|
|
# the wrapper compiler mpif90.
|
|
|
|
#
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_fcflags_save="$FCFLAGS"
|
2004-01-08 16:34:31 +03:00
|
|
|
AC_PROG_FC
|
2004-06-07 19:33:53 +04:00
|
|
|
FCFLAGS="$ompi_fcflags_save"
|
2004-01-08 16:34:31 +03:00
|
|
|
if test -z "$FC"; then
|
2004-03-28 14:30:36 +04:00
|
|
|
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (could not find compiler)])
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_WANT_F90_BINDINGS=0
|
|
|
|
OMPI_F90="none"
|
2004-03-28 14:52:58 +04:00
|
|
|
BASEF90="none"
|
2004-01-08 16:34:31 +03:00
|
|
|
elif test "$FC" = "$F77"; then
|
2004-01-10 01:54:32 +03:00
|
|
|
AC_MSG_WARN([*** Found same compiler for Fortran 77 and 90/95.])
|
|
|
|
AC_MSG_WARN([*** Assuming no Fortran 90/95 compiler; disabling])
|
2004-03-28 14:30:36 +04:00
|
|
|
AC_MSG_WARN([*** Fortran 90/95 MPI bindings.])
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_WANT_F90_BINDINGS=0
|
|
|
|
OMPI_F90="none"
|
2004-03-28 14:52:58 +04:00
|
|
|
BASEF90="none"
|
2004-01-08 16:34:31 +03:00
|
|
|
else
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_F90="$FC"
|
2004-01-10 01:54:32 +03:00
|
|
|
BASEF90="`basename $FC`"
|
2004-03-28 14:02:38 +04:00
|
|
|
|
|
|
|
AC_LANG_PUSH(Fortran)
|
|
|
|
AC_FC_SRCEXT(f)
|
|
|
|
AC_FC_SRCEXT(f90)
|
|
|
|
AC_FC_SRCEXT(f95)
|
|
|
|
AC_LANG_POP(Fortran)
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_MSG_CHECKING([whether $OMPI_F77 and $OMPI_F90 compilers are compatible])
|
|
|
|
OMPI_INTL_F90_F77_INTERACTION(fortran_goodness=1, fortran_goodness=0)
|
2004-03-28 14:02:38 +04:00
|
|
|
if test "$fortran_goodness" = "0" ; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_WARN([*** Fortran 77 and Fortran 90 compilers are not link compatible])
|
2004-03-28 14:30:36 +04:00
|
|
|
AC_MSG_WARN([*** Disabling Fortran 90/95 bindings])
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_WANT_F90_BINDINGS=0
|
2004-03-28 14:02:38 +04:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([yes])
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_WANT_F90_BINDINGS=1
|
2004-03-28 14:02:38 +04:00
|
|
|
fi
|
2004-01-08 16:34:31 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFINE_UNQUOTED(OMPI_WANT_F90_BINDINGS, $OMPI_WANT_F90_BINDINGS,
|
2004-01-29 06:13:45 +03:00
|
|
|
[Whether we want the MPI f90 bindings or not])
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFINE_UNQUOTED(OMPI_F90, "$OMPI_F90", [OMPI underlying F90 compiler])
|
|
|
|
AM_CONDITIONAL(OMPI_WANT_F90_BINDINGS, test "$OMPI_WANT_F90_BINDINGS" = "1")
|
2004-03-28 14:02:38 +04:00
|
|
|
unset fortran_goodness
|
2004-01-08 16:34:31 +03:00
|
|
|
])
|
2004-03-28 14:02:38 +04:00
|
|
|
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_INTL_F90_F77_INTERACTION], [
|
2004-03-28 14:02:38 +04:00
|
|
|
# make sure that we can combine F90 and F77 code
|
|
|
|
AC_LANG_PUSH(Fortran)
|
|
|
|
# Fortran module
|
|
|
|
cat > conftestf77.f <<EOF
|
|
|
|
subroutine Conf1_test()
|
|
|
|
end
|
|
|
|
EOF
|
|
|
|
cat > conftestf90.f <<EOF
|
|
|
|
program main
|
|
|
|
call Conf1_test()
|
|
|
|
end
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Try the compile
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_LOG_COMMAND(
|
|
|
|
[$OMPI_F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
|
|
|
|
OMPI_LOG_COMMAND(
|
|
|
|
[$OMPI_F77 $FFLAGS -c conftestf77.f],
|
|
|
|
OMPI_LOG_COMMAND(
|
|
|
|
[$OMPI_F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LIBS],
|
2004-03-28 14:02:38 +04:00
|
|
|
[HAPPY=1],
|
|
|
|
[HAPPY=0]),
|
|
|
|
[HAPPY=0]),
|
|
|
|
[HAPPY=0])
|
|
|
|
|
|
|
|
if test "$HAPPY" = "1"; then
|
|
|
|
$1
|
|
|
|
else
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_LOG_MSG([here is the F77 program:], 1)
|
|
|
|
OMPI_LOG_FILE([conftestf77.f])
|
|
|
|
OMPI_LOG_MSG([here is the F90 program:], 1)
|
|
|
|
OMPI_LOG_FILE([conftestf90.f90])
|
2004-03-28 14:02:38 +04:00
|
|
|
$2
|
|
|
|
fi
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
unset HAPPY ompi_conftest_h
|
2004-03-28 14:02:38 +04:00
|
|
|
/bin/rm -f conftest*
|
|
|
|
|
|
|
|
AC_LANG_POP(Fortran)
|
|
|
|
])dnl
|