psblas3-submodules
Salvatore Filippone 10 years ago
parent c9d03810db
commit e4169bdaf9

@ -93,6 +93,52 @@ ifelse([$2], , , [ rm -rf conftest*
fi
rm -f conftest*])
dnl @synopsis PAC_FORTRAN_HAVE_SUBMODULE( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Will try to compile and link a program with SUBMODULEs (a Fortran 2008 feature).
dnl
dnl Will use MPIFC, otherwise '$FC'.
dnl
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
dnl
dnl
AC_DEFUN([PAC_FORTRAN_HAVE_SUBMODULE],
ac_objext='.o'
ac_ext='f90'
ac_compile='${MPIFC-$FC} -c -o conftest${ac_objext} $FCFLAGS conftest.$ac_ext 1>&5'
dnl Warning : square brackets are EVIL!
[AC_MSG_CHECKING([for Fortran SUBMODULEs])
cat > conftest.$ac_ext <<EOF
module test
interface
module subroutine foo(bar)
integer :: bar
end subroutine
end interface
end module test
submodule (test) test_impl
contains
subroutine foo(bar)
integer :: bar
bar = 1
end subroutine foo
end submodule test_impl
EOF
if AC_TRY_EVAL(ac_compile) && test -s conftest${ac_objext}; then
AC_MSG_RESULT([yes])
ifelse([$1], , :, [rm -rf conftest*
$1])
else
AC_MSG_RESULT([no])
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
ifelse([$2], , , [ rm -rf conftest*
$2
])dnl
fi
rm -f conftest*])
dnl @synopsis PAC_CHECK_HAVE_CRAYFTN( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])

42
configure vendored

@ -7033,6 +7033,48 @@ $as_echo "no" >&6; }
fi
rm -f conftest*
ac_objext='.o'
ac_ext='f90'
ac_compile='${MPIFC-$FC} -c -o conftest${ac_objext} $FCFLAGS conftest.$ac_ext 1>&5'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran SUBMODULEs" >&5
$as_echo_n "checking for Fortran SUBMODULEs... " >&6; }
cat > conftest.$ac_ext <<EOF
module test
interface
module subroutine foo(bar)
integer :: bar
end subroutine
end interface
end module test
submodule (test) test_impl
contains
subroutine foo(bar)
integer :: bar
bar = 1
end subroutine foo
end submodule test_impl
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s conftest${ac_objext}; 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
rm -rf conftest*
as_fn_error $? "Sorry, cannot build PSBLAS without support for SUBMODULES.
Please get a Fortran compiler that supports it." "$LINENO" 5
fi
rm -f conftest*
ac_exeext=''
ac_ext='f90'
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'

@ -569,6 +569,12 @@ PAC_FORTRAN_HAVE_MOVE_ALLOC(
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.6.])]
)
PAC_FORTRAN_HAVE_SUBMODULE(
[],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for SUBMODULES.
Please get a Fortran compiler that supports it.])]
)
PAC_FORTRAN_TEST_ISO_C_BIND(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_ISO_C_BINDING $FDEFINES"],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for ISO_C_BINDING.

Loading…
Cancel
Save