Make some Fortran features mandatory.

This commit is contained in:
Salvatore Filippone
2020-07-24 10:57:27 +02:00
parent 5d246284cd
commit 68a4ee9cd4
2 changed files with 71 additions and 63 deletions
Vendored
+60 -56
View File
@@ -6744,10 +6744,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
# Optional features
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for Fortran VOLATILE" >&5
$as_echo_n "checking support for Fortran VOLATILE... " >&6; }
ac_ext=${ac_fc_srcext-f}
@@ -6767,12 +6763,13 @@ _ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FDEFINES="$psblas_cv_define_prepend-DHAVE_VOLATILE $FDEFINES"
:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
as_fn_error $? "Sorry, cannot build PSBLAS without support for VOLATILE" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -6784,6 +6781,64 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for Fortran FINAL" >&5
$as_echo_n "checking support for Fortran FINAL... " >&6; }
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
ac_exeext=''
ac_ext='f90'
ac_fc=${MPIFC-$FC};
cat > conftest.$ac_ext <<_ACEOF
module conftest_mod
type foo
integer :: i
contains
final :: destroy_foo
end type foo
private destroy_foo
contains
subroutine destroy_foo(a)
type(foo) :: a
! Just a test
end subroutine destroy_foo
end module conftest_mod
program conftest
use conftest_mod
type(foo) :: foovar
end program conftest
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
as_fn_error $? "Sorry, cannot build PSBLAS without support for FINAL" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
# Optional features
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking test GENERIC interfaces" >&5
$as_echo_n "checking test GENERIC interfaces... " >&6; }
ac_ext=${ac_fc_srcext-f}
@@ -6872,57 +6927,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for Fortran FINAL" >&5
$as_echo_n "checking support for Fortran FINAL... " >&6; }
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
ac_exeext=''
ac_ext='f90'
ac_fc=${MPIFC-$FC};
cat > conftest.$ac_ext <<_ACEOF
module conftest_mod
type foo
integer :: i
contains
final :: destroy_foo
end type foo
private destroy_foo
contains
subroutine destroy_foo(a)
type(foo) :: a
! Just a test
end subroutine destroy_foo
end module conftest_mod
program conftest
use conftest_mod
type(foo) :: foovar
end program conftest
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FDEFINES="$psblas_cv_define_prepend-DHAVE_FINAL $FDEFINES"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for Fortran SAME_TYPE_AS" >&5
$as_echo_n "checking support for Fortran SAME_TYPE_AS... " >&6; }
ac_ext=${ac_fc_srcext-f}
+11 -7
View File
@@ -573,13 +573,21 @@ PAC_FORTRAN_TEST_ISO_FORTRAN_ENV(
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8.])]
)
PAC_FORTRAN_TEST_VOLATILE(
[],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for VOLATILE])]
)
PAC_FORTRAN_TEST_FINAL(
[],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for FINAL])]
)
#
# Optional features
#
PAC_FORTRAN_TEST_VOLATILE(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_VOLATILE $FDEFINES"],
)
PAC_FORTRAN_TEST_GENERICS(
[],
@@ -591,10 +599,6 @@ PAC_FORTRAN_TEST_FLUSH(
)
PAC_FORTRAN_TEST_FINAL(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_FINAL $FDEFINES"],
)
PAC_FORTRAN_TEST_SAME_TYPE(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_SAME_TYPE_AS $FDEFINES"],
)