diff --git a/config/pac.m4 b/config/pac.m4 index 0acc2cde..424b06ce 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -335,7 +335,7 @@ ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext dnl Warning : square brackets are EVIL! [cat > conftest.$ac_ext < +AC_DEFUN(PAC_FORTRAN_TEST_EXTENDS, +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +dnl Warning : square brackets are EVIL! +[AC_MSG_CHECKING([support for Fortran EXTENDS]) +i=0 +while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do + i=`expr $i + 1` +done +mkdir tmpdir_$i +cd tmpdir_$i +cat > conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$2], , , [ + $2 +])dnl +fi +cd .. +rm -fr tmpdir_$i]) + +dnl @synopsis PAC_FORTRAN_TEST_CLASS_TBP( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl +dnl Will try to compile and link a program checking the TBP Fortran support. +dnl +dnl Will use MPIFC, otherwise '$FC'. +dnl +dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND. +dnl Note : This file will be likely to induce the compiler to create a module file +dnl (for a module called conftest). +dnl Depending on the compiler flags, this could cause a conftest.mod file to appear +dnl in the present directory, or in another, or with another name. So be warned! +dnl +dnl @author Salvatore Filippone +AC_DEFUN(PAC_FORTRAN_TEST_CLASS_TBP, +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +dnl Warning : square brackets are EVIL! +[AC_MSG_CHECKING([support for Fortran CLASS TBP]) +i=0 +while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do + i=`expr $i + 1` +done +mkdir tmpdir_$i +cd tmpdir_$i +cat > conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$2], , , [ + $2 +])dnl +fi +cd .. +rm -fr tmpdir_$i]) + + +dnl @synopsis PAC_FORTRAN_TEST_FINAL( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl +dnl Will try to compile and link a program checking the FINAL Fortran support. +dnl +dnl Will use MPIFC, otherwise '$FC'. +dnl +dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND. +dnl Note : This file will be likely to induce the compiler to create a module file +dnl (for a module called conftest). +dnl Depending on the compiler flags, this could cause a conftest.mod file to appear +dnl in the present directory, or in another, or with another name. So be warned! +dnl +dnl @author Salvatore Filippone +AC_DEFUN(PAC_FORTRAN_TEST_FINAL, +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +dnl Warning : square brackets are EVIL! +[AC_MSG_CHECKING([support for Fortran FINAL]) +i=0 +while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do + i=`expr $i + 1` +done +mkdir tmpdir_$i +cd tmpdir_$i +cat > conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$2], , , [ + $2 +])dnl +fi +cd .. +rm -fr tmpdir_$i]) + + dnl @synopsis PAC_CHECK_BLACS dnl dnl Will try to find the BLACS diff --git a/configure b/configure index d349ef30..ec1280cc 100755 --- a/configure +++ b/configure @@ -5604,95 +5604,6 @@ else fi rm -f conftest* -# -# Test for TR 15581, aka allocatables extensions. -# -ac_exeext='' -ac_ext='f90' -ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -{ $as_echo "$as_me:$LINENO: checking support for Fortran allocatables TR15581" >&5 -$as_echo_n "checking support for Fortran allocatables TR15581... " >&6; } -i=0 -while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do - i=`expr $i + 1` -done -mkdir tmpdir_$i -cd tmpdir_$i -cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - : -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - - { { $as_echo "$as_me:$LINENO: error: Sorry, cannot build PSBLAS without support for TR15581. - Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.3." >&5 -$as_echo "$as_me: error: Sorry, cannot build PSBLAS without support for TR15581. - Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.3." >&2;} - { (exit 1); exit 1; }; } - -fi -cd .. -rm -fr tmpdir_$i - if test x"$psblas_cv_fc" == "x" ; then if eval "$MPIFC -qversion 2>&1 | grep XL 2>/dev/null" ; then psblas_cv_fc="xlf" @@ -7461,7 +7372,215 @@ fi rm -f conftest* fi -# Custom test : do we have move_alloc ? + +# +# Tests for support of various Fortran features; some of them are critical, +# some optional +# + +# +# Critical features +# +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +{ $as_echo "$as_me:$LINENO: checking support for Fortran allocatables TR15581" >&5 +$as_echo_n "checking support for Fortran allocatables TR15581... " >&6; } +i=0 +while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do + i=`expr $i + 1` +done +mkdir tmpdir_$i +cd tmpdir_$i +cat > conftest.$ac_ext <&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + : +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + + { { $as_echo "$as_me:$LINENO: error: Sorry, cannot build PSBLAS without support for TR15581. + Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.5." >&5 +$as_echo "$as_me: error: Sorry, cannot build PSBLAS without support for TR15581. + Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.5." >&2;} + { (exit 1); exit 1; }; } + +fi +cd .. +rm -fr tmpdir_$i + +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +{ $as_echo "$as_me:$LINENO: checking support for Fortran EXTENDS" >&5 +$as_echo_n "checking support for Fortran EXTENDS... " >&6; } +i=0 +while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do + i=`expr $i + 1` +done +mkdir tmpdir_$i +cd tmpdir_$i +cat > conftest.$ac_ext <&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + : +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + + { { $as_echo "$as_me:$LINENO: error: Sorry, cannot build PSBLAS without support for EXTENDS. + Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.5." >&5 +$as_echo "$as_me: error: Sorry, cannot build PSBLAS without support for EXTENDS. + Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.5." >&2;} + { (exit 1); exit 1; }; } + +fi +cd .. +rm -fr tmpdir_$i + +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +{ $as_echo "$as_me:$LINENO: checking support for Fortran CLASS TBP" >&5 +$as_echo_n "checking support for Fortran CLASS TBP... " >&6; } +i=0 +while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do + i=`expr $i + 1` +done +mkdir tmpdir_$i +cd tmpdir_$i +cat > conftest.$ac_ext <&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + : +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + + { { $as_echo "$as_me:$LINENO: error: Sorry, cannot build PSBLAS without support for CLASS and type bound procedures. + Please get a Fortran compiler that supports them, e.g. GNU Fortran 4.5." >&5 +$as_echo "$as_me: error: Sorry, cannot build PSBLAS without support for CLASS and type bound procedures. + Please get a Fortran compiler that supports them, e.g. GNU Fortran 4.5." >&2;} + { (exit 1); exit 1; }; } + +fi +cd .. +rm -fr tmpdir_$i + +# +# Optional features +# ac_exeext='' ac_ext='f' ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' @@ -7527,6 +7646,55 @@ fi cd .. rm -fr tmpdir_$i +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +{ $as_echo "$as_me:$LINENO: checking support for Fortran FINAL" >&5 +$as_echo_n "checking support for Fortran FINAL... " >&6; } +i=0 +while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do + i=`expr $i + 1` +done +mkdir tmpdir_$i +cd tmpdir_$i +cat > conftest.$ac_ext <&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + + FDEFINES="$psblas_cv_define_prepend-DHAVE_FINAL $FDEFINES" +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +cd .. +rm -fr tmpdir_$i + ############################################################################### # Additional pathname stuff (yes, it is redundant and confusing...) ############################################################################### diff --git a/configure.ac b/configure.ac index 18646e63..75c6b87d 100755 --- a/configure.ac +++ b/configure.ac @@ -212,15 +212,6 @@ PAC_CHECK_HAVE_GFORTRAN( [] ) -# -# Test for TR 15581, aka allocatables extensions. -# -PAC_FORTRAN_TEST_TR15581( - [], - [AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for TR15581. - Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.3.])] -) - if test x"$psblas_cv_fc" == "x" ; then if eval "$MPIFC -qversion 2>&1 | grep XL 2>/dev/null" ; then psblas_cv_fc="xlf" @@ -532,7 +523,36 @@ else ) fi -# Custom test : do we have move_alloc ? + +# +# Tests for support of various Fortran features; some of them are critical, +# some optional +# + +# +# Critical features +# +PAC_FORTRAN_TEST_TR15581( + [], + [AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for TR15581. + Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.5.])] +) + +PAC_FORTRAN_TEST_EXTENDS( + [], + [AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for EXTENDS. + Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.5.])] +) + +PAC_FORTRAN_TEST_CLASS_TBP( + [], + [AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for CLASS and type bound procedures. + Please get a Fortran compiler that supports them, e.g. GNU Fortran 4.5.])] +) + +# +# Optional features +# PAC_FORTRAN_HAVE_MOVE_ALLOC( [FDEFINES="$psblas_cv_define_prepend-DHAVE_MOVE_ALLOC $FDEFINES"], @@ -542,6 +562,10 @@ PAC_FORTRAN_TEST_VOLATILE( [FDEFINES="$psblas_cv_define_prepend-DHAVE_VOLATILE $FDEFINES"], ) +PAC_FORTRAN_TEST_FINAL( + [FDEFINES="$psblas_cv_define_prepend-DHAVE_FINAL $FDEFINES"], +) + ############################################################################### # Additional pathname stuff (yes, it is redundant and confusing...) ###############################################################################