diff --git a/config/pac.m4 b/config/pac.m4 index 5f636928..27419db3 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -600,6 +600,63 @@ cd .. rm -fr tmpdir_$i]) +dnl @synopsis PAC_FORTRAN_TEST_GENERICS( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl +dnl Will try to compile a program checking the GENERIC 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 Michele Martone +dnl @author Salvatore Filippone +AC_DEFUN(PAC_FORTRAN_TEST_GENERICS, +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([test GENERIC interfaces]) +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_EXTENDS( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl diff --git a/configure b/configure index 839c67a8..3ed080fc 100755 --- a/configure +++ b/configure @@ -651,6 +651,7 @@ FINCLUDES CINCLUDES METIS_LIBS AMD_LIBS +INSTALL_SAMPLESDIR INSTALL_DOCSDIR INSTALL_INCLUDEDIR INSTALL_LIBDIR @@ -2141,8 +2142,12 @@ case $docsdir in \/* ) eval "INSTALL_DOCSDIR=$docsdir";; * ) eval "INSTALL_DOCSDIR=$INSTALL_DIR/docs";; esac -{ $as_echo "$as_me:$LINENO: result: $INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR" >&5 -$as_echo "$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR" >&6; } +case $samplesdir in + \/* ) eval "INSTALL_SAMPLESDIR=$samplesdir";; + * ) eval "INSTALL_SAMPLESDIR=$INSTALL_DIR/samples";; +esac +{ $as_echo "$as_me:$LINENO: result: $INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR" >&5 +$as_echo "$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR" >&6; } # Note that the following line won't save from troubles. ac_ext=${ac_fc_srcext-f} @@ -7839,6 +7844,52 @@ fi cd .. rm -fr tmpdir_$i +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:$LINENO: checking test GENERIC interfaces" >&5 +$as_echo_n "checking test GENERIC interfaces... " >&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_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_objext}; 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 + + FDEFINES="$psblas_cv_define_prepend-DBAD_GENERICS $FDEFINES" + +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' @@ -10929,6 +10980,7 @@ UTILLIBNAME=libpsb_util.a + PSBLASRULES=' diff --git a/configure.ac b/configure.ac index dfedf8c7..36def0b9 100755 --- a/configure.ac +++ b/configure.ac @@ -582,6 +582,11 @@ PAC_FORTRAN_TEST_VOLATILE( [FDEFINES="$psblas_cv_define_prepend-DHAVE_VOLATILE $FDEFINES"], ) +PAC_FORTRAN_TEST_GENERICS( + [], + [FDEFINES="$psblas_cv_define_prepend-DBAD_GENERICS $FDEFINES"] +) + PAC_FORTRAN_TEST_FLUSH( [FDEFINES="$psblas_cv_define_prepend-DHAVE_FLUSH_STMT $FDEFINES"], )