Fixes for old compilers:
* If the Fortran compiler doesn't support ISO_C_BINDINGS, fall back to an older (less precise) test for KIND values * If we're building the mpi module, don't assume that we're also building mpi_f08 module (i.e., don't add -lmpi_usempif08 to mpifort unless we're actually building the mpi_f08 module) This commit was SVN r26294.
Этот коммит содержится в:
родитель
6cf8d8ad95
Коммит
5e0a154fa3
@ -138,8 +138,10 @@ AC_DEFUN([OMPI_FORTRAN_CHECK], [
|
|||||||
[AC_MSG_RESULT([<skipped>])])
|
[AC_MSG_RESULT([<skipped>])])
|
||||||
|
|
||||||
# See if the value is -1. If so, then just say we don't
|
# See if the value is -1. If so, then just say we don't
|
||||||
# have a match.
|
# have a match. If the compiler doesn't support
|
||||||
OMPI_FORTRAN_GET_KIND_VALUE([$ofc_type_kind], [ofc_type_kind_value])
|
# ISO_C_BINDING, then we'll just fall back to a default
|
||||||
|
# kind and hope for the best. :-\
|
||||||
|
OMPI_FORTRAN_GET_KIND_VALUE([$ofc_type_kind], 4, [ofc_type_kind_value])
|
||||||
AS_IF([test $ofc_type_kind_value -le 0],
|
AS_IF([test $ofc_type_kind_value -le 0],
|
||||||
[ofc_have_type=0
|
[ofc_have_type=0
|
||||||
AC_MSG_WARN([Compiler $1 and $ofc_c_type mismatch; MPI datatype unsupported])])
|
AC_MSG_WARN([Compiler $1 and $ofc_c_type mismatch; MPI datatype unsupported])])
|
||||||
|
@ -39,13 +39,14 @@ AC_DEFUN([OMPI_FORTRAN_GET_KIND_VALUE],[
|
|||||||
write(7, *) $1
|
write(7, *) $1
|
||||||
close(7)
|
close(7)
|
||||||
]]), [value=`cat conftest.out | awk '{print [$]1}'`], [value=no], [value=cross])
|
]]), [value=`cat conftest.out | awk '{print [$]1}'`], [value=no], [value=cross])
|
||||||
|
rm -f conftest.out
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the compiler is ancient enough to not support the
|
# If the compiler is ancient enough to not support the
|
||||||
# ISO_C_BINDING stuff, then we have to fall back to older
|
# ISO_C_BINDING stuff, then we have to fall back to older
|
||||||
# tests. Yuck.
|
# tests. Yuck.
|
||||||
AS_IF([test "$value" = "no"],
|
AS_IF([test "$value" = "no"],
|
||||||
[AC_MSG_RESULT([ISO_C_BINDING not supported -- fallback])
|
[AC_MSG_RESULT([no ISO_C_BINDING -- fallback])
|
||||||
_OMPI_FORTRAN_SELECTED_INT_KIND($2, value)])
|
_OMPI_FORTRAN_SELECTED_INT_KIND($2, value)])
|
||||||
|
|
||||||
AS_IF([test "$value" = "no"],
|
AS_IF([test "$value" = "no"],
|
||||||
@ -68,27 +69,29 @@ AC_DEFUN([OMPI_FORTRAN_GET_KIND_VALUE],[
|
|||||||
# _OMPI_FORTRAN_SELECTED_INT_KIND(decimal range, variable to set)
|
# _OMPI_FORTRAN_SELECTED_INT_KIND(decimal range, variable to set)
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
AC_DEFUN([_OMPI_FORTRAN_SELECTED_INT_KIND],[
|
AC_DEFUN([_OMPI_FORTRAN_SELECTED_INT_KIND],[
|
||||||
AS_VAR_PUSHDEF([type_var], [ompi_cv_fortran_int_kind_$1])
|
AS_VAR_PUSHDEF([sel_int_kind_var], [ompi_cv_fortran_int_kind_$1])
|
||||||
|
AC_CACHE_CHECK([Fortran value of selected_int_kind($1)], sel_int_kind_var,
|
||||||
|
[outval=no
|
||||||
|
|
||||||
if test $OMPI_WANT_FORTRAN_BINDINGS -eq 1 -a $ompi_fortran_happy -eq 1; then
|
AS_IF([test $OMPI_WANT_FORTRAN_BINDINGS -eq 1 -a $ompi_fortran_happy -eq 1],
|
||||||
AC_CACHE_CHECK([Fortran value of selected_int_kind($1)],
|
[rm -f conftest.out
|
||||||
type_var,
|
AC_LANG_PUSH([Fortran])
|
||||||
[AC_LANG_PUSH([Fortran])
|
AC_RUN_IFELSE(AC_LANG_PROGRAM(, [[
|
||||||
value=
|
|
||||||
AC_RUN_IFELSE(AC_LANG_PROGRAM(, [[
|
|
||||||
open(8, file="conftest.out")
|
open(8, file="conftest.out")
|
||||||
write(8, fmt="(I5)") selected_int_kind($1)
|
write(8, fmt="(I5)") selected_int_kind($1)
|
||||||
close(8)
|
close(8)
|
||||||
]]), [value=`cat conftest.out | awk '{print [$]1}'`], [value=no], [value=cross])
|
]]), [outval=`cat conftest.out | awk '{print [$]1}'`], [outval=no], [outval=cross])
|
||||||
|
rm -f conftest.out
|
||||||
|
AC_LANG_POP([Fortran])
|
||||||
|
])
|
||||||
|
|
||||||
AC_LANG_POP([Fortran])])
|
AS_VAR_SET(sel_int_kind_var, [$outval])
|
||||||
|
unset outval
|
||||||
|
])
|
||||||
|
|
||||||
# All analysis of $value is done in the upper-level / calling
|
# All analysis of $value is done in the upper-level / calling
|
||||||
# macro
|
# macro
|
||||||
|
|
||||||
AS_VAR_COPY([$2], [type_var])
|
AS_VAR_COPY([$2], [sel_int_kind_var])
|
||||||
else
|
AS_VAR_POPDEF([sel_int_kind_var])dnl
|
||||||
$2=skipped
|
|
||||||
fi
|
|
||||||
AS_VAR_POPDEF([type_var])dnl
|
|
||||||
])
|
])
|
||||||
|
@ -238,9 +238,9 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
|
|||||||
# the Fortran/C interop C_INTxx_T KIND values). So figure out
|
# the Fortran/C interop C_INTxx_T KIND values). So figure out
|
||||||
# those KIND values here and just substitue them in via
|
# those KIND values here and just substitue them in via
|
||||||
# AC_DEFINE's. Kinda gross, but there you are. :-\
|
# AC_DEFINE's. Kinda gross, but there you are. :-\
|
||||||
OMPI_FORTRAN_GET_KIND_VALUE([C_INT16_T], 9, [OMPI_FORTRAN_C_INT16_T_KIND])
|
OMPI_FORTRAN_GET_KIND_VALUE([C_INT16_T], 4, [OMPI_FORTRAN_C_INT16_T_KIND])
|
||||||
OMPI_FORTRAN_GET_KIND_VALUE([C_INT32_T], 18, [OMPI_FORTRAN_C_INT32_T_KIND])
|
OMPI_FORTRAN_GET_KIND_VALUE([C_INT32_T], 9, [OMPI_FORTRAN_C_INT32_T_KIND])
|
||||||
OMPI_FORTRAN_GET_KIND_VALUE([C_INT64_T], 19, [OMPI_FORTRAN_C_INT64_T_KIND])
|
OMPI_FORTRAN_GET_KIND_VALUE([C_INT64_T], 18, [OMPI_FORTRAN_C_INT64_T_KIND])
|
||||||
|
|
||||||
# Get the kind value for Fortran MPI_INTEGER_KIND (corresponding
|
# Get the kind value for Fortran MPI_INTEGER_KIND (corresponding
|
||||||
# to whatever is the same size as a F77 INTEGER -- for the
|
# to whatever is the same size as a F77 INTEGER -- for the
|
||||||
@ -318,7 +318,6 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
|
|||||||
# We now know that we can now build the mpi module
|
# We now know that we can now build the mpi module
|
||||||
# with at least ignore TKR functionality
|
# with at least ignore TKR functionality
|
||||||
OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS=1
|
OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS=1
|
||||||
OMPI_FORTRAN_USEMPIF08_LIB=-lmpi_usempif08
|
|
||||||
OMPI_FORTRAN_F08_PREDECL=$OMPI_FORTRAN_IGNORE_TKR_PREDECL
|
OMPI_FORTRAN_F08_PREDECL=$OMPI_FORTRAN_IGNORE_TKR_PREDECL
|
||||||
OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE])
|
OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE])
|
||||||
])
|
])
|
||||||
@ -446,7 +445,8 @@ end type test_mpi_handle],
|
|||||||
])
|
])
|
||||||
AC_MSG_CHECKING([if building Fortran 'use mpi_f08' bindings])
|
AC_MSG_CHECKING([if building Fortran 'use mpi_f08' bindings])
|
||||||
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
|
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
|
||||||
[AC_MSG_RESULT([yes])],
|
[OMPI_FORTRAN_USEMPIF08_LIB=-lmpi_usempif08
|
||||||
|
AC_MSG_RESULT([yes])],
|
||||||
[AC_MSG_RESULT([no])])
|
[AC_MSG_RESULT([no])])
|
||||||
|
|
||||||
# -------------------
|
# -------------------
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user