1
1

* skip some F90 tests if we aren't compilng F90

* Make sure to invalidate the cache on a couple of tests when we don't
  want F77/F90

This commit was SVN r8994.
Этот коммит содержится в:
Brian Barrett 2006-02-12 16:59:56 +00:00
родитель e5ac52c246
Коммит 74860649bc
4 изменённых файлов: 71 добавлений и 54 удалений

Просмотреть файл

@ -21,6 +21,11 @@ dnl
AC_DEFUN([OMPI_F77_FIND_EXT_SYMBOL_CONVENTION], [
AC_REQUIRE([AC_PROG_NM])
# invalidate cache if result came from a run where F77 was disabled
if test "$ompi_cv_f77_external_symbol" = "skipped" ; then
unset ompi_cv_f77_external_symbol
fi
AC_CACHE_CHECK([$F77 external symbol convention],
[ompi_cv_f77_external_symbol],
[if test "$F77" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0"; then

Просмотреть файл

@ -20,6 +20,11 @@ dnl
# -------------------------------------------------------
# Determine the value of .TRUE. of this FORTRAN compiler.
AC_DEFUN([OMPI_F77_GET_VALUE_TRUE],[
# 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
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

Просмотреть файл

@ -20,19 +20,17 @@ dnl
AC_DEFUN([OMPI_F90_FIND_MODULE_INCLUDE_FLAG],[
AS_VAR_PUSHDEF([f90_inc_var], [ompi_cv_f90_module_include_flag])
AC_CACHE_CHECK([for Fortran 90 compiler module include flag], f90_inc_var,
[ofi_possible_flags="-I -p -M"
if test "$OMPI_WANT_F90_BINDINGS" -eq 1 ; then
AC_CACHE_CHECK([for Fortran 90 compiler module include flag],
f90_inc_var,
[ofi_possible_flags="-I -p -M"
mkdir conftest.$$
cd conftest.$$
mkdir conftest.$$
cd conftest.$$
#
# Try to compile an F90 module
#
mkdir subdir
cd subdir
cat > conftest-module.f90 <<EOF
# Try to compile an F90 module
mkdir subdir
cd subdir
cat > conftest-module.f90 <<EOF
module OMPI_MOD_FLAG
type OMPI_MOD_FLAG_TYPE
@ -42,39 +40,44 @@ module OMPI_MOD_FLAG
end module OMPI_MOD_FLAG
EOF
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -c conftest-module.f90 $LDFLAGS $LIBS], ,
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -c conftest-module.f90 $LDFLAGS $LIBS], ,
[cd ..
rm -rf conftest.$$
AC_MSG_RESULT([Whoops!])
AC_MSG_WARN([*** Cannot seem to compile an f90 module])
AC_MSG_ERROR([Cannot continue]))
cd ..
AC_MSG_ERROR([Cannot continue])])
cd ..
#
# Now try to compile a simple program usinng that module, iterating
# through the possible flags that the compiler might use
#
#
# Now try to compile a simple program usinng that module, iterating
# through the possible flags that the compiler might use
#
cat > conftest.f90 <<EOF
cat > conftest.f90 <<EOF
program f90usemodule
use OMPI_MOD_FLAG
end program f90usemodule
EOF
ofi_module_flag=
for flag in $ofi_possible_flags; do
if test "$ofi_module_flag" = ""; then
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 conftest.f90 ${flag}subdir $LDFLAGS $LIBS],
[AS_VAR_SET(f90_inc_var, [$flag])
ofi_module_flag="$flag"])
fi
done
cd ..
rm -rf conftest.$$
])
ofi_module_flag=
for flag in $ofi_possible_flags; do
if test "$ofi_module_flag" = ""; then
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 conftest.f90 ${flag}subdir $LDFLAGS $LIBS],
[AS_VAR_SET(f90_inc_var, [$flag])
ofi_module_flag="$flag"])
fi
done
cd ..
rm -rf conftest.$$
])
OMPI_FC_MODULE_FLAG=AS_VAR_GET(f90_inc_var)
if test "$OMPI_FC_MODULE_FLAG" = ""; then
AC_MSG_WARN([*** Could not determine the f90 compiler flag to indicate where modules reside])
AC_MSG_ERROR([*** Cannot continue])
OMPI_FC_MODULE_FLAG=AS_VAR_GET(f90_inc_var)
if test "$OMPI_FC_MODULE_FLAG" = ""; then
AC_MSG_WARN([*** Could not determine the f90 compiler flag to indicate where modules reside])
AC_MSG_ERROR([*** Cannot continue])
fi
else
OMPI_FC_MODULE_FLAG=
fi
AC_SUBST(OMPI_FC_MODULE_FLAG)
AS_VAR_POPDEF([f90_inc_var])

Просмотреть файл

@ -22,9 +22,10 @@ dnl
AC_DEFUN([OMPI_F90_GET_INT_KIND],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_int_kind_$2])
AC_CACHE_CHECK([Fortran 90 kind of $1 (selected_int_kind($2))],
type_var,
[cat > conftestf.f90 <<EOF
if test "$OMPI_WANT_F90_BINDINGS" -eq 1 ; then
AC_CACHE_CHECK([Fortran 90 kind of $1 (selected_int_kind($2))],
type_var,
[cat > conftestf.f90 <<EOF
program f90findintkind
open(8, file="conftestval")
write(8, fmt="(I5)") selected_int_kind($2)
@ -32,27 +33,30 @@ program f90findintkind
end program
EOF
# Try to compile
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftestf.f90 $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])
# Try to compile
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftestf.f90 $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])
if test "$happy" = "no"; then
OMPI_LOG_MSG([here is the fortran 90 program:], 1)
OMPI_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not kind of selected_int_kind($1)])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
if test "$happy" = "no"; then
OMPI_LOG_MSG([here is the fortran 90 program:], 1)
OMPI_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not kind of selected_int_kind($1)])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine kind of selected_int_kind($1) when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`sed 's/ *//' conftestval`])],
[AC_MSG_ERROR([Could not determine kind of selected_int_kind($1)])])])
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine kind of selected_int_kind($1) when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`sed 's/ *//' conftestval`])],
[AC_MSG_ERROR([Could not determine kind of selected_int_kind($1)])])])
unset happy ompi_conftest_h
rm -f conftest*])
$3=AS_VAR_GET(type_var)
$3=AS_VAR_GET(type_var)
else
$3=0
fi
AS_VAR_POPDEF([type_var])dnl
])