diff --git a/config/pac.m4 b/config/pac.m4 index 410d8bea..b4bc5515 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -254,6 +254,44 @@ rm -f conftest*]) +dnl @synopsis PAC_FORTRAN_CHECK_HAVE_MPI_MOD_F08( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl +dnl Will determine if the fortran compiler MPIFC provides mpi_f08 +dnl +dnl If yes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND. +dnl +dnl @author Michele Martone +dnl Modified Salvatore Filippone +dnl +AC_DEFUN(PAC_FORTRAN_CHECK_HAVE_MPI_MOD_F08, +ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +dnl Warning : square brackets are EVIL! +[AC_MSG_CHECKING([MPI Fortran 2008 interface]) +cat > conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + AC_MSG_RESULT([ no. ]) +ifelse([$2], , , [ rm -rf conftest* + $2 +])dnl +fi +rm -f conftest*]) + + + dnl @synopsis PAC_ARG_WITH_FLAGS(lcase_name, UCASE_NAME) dnl dnl Test for --with-lcase_name="compiler/loader flags". if defined, prepend diff --git a/configure b/configure index 97da0289..acf6a848 100755 --- a/configure +++ b/configure @@ -7376,6 +7376,36 @@ else ac_exeext='' ac_ext='f90' ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +{ $as_echo "$as_me:$LINENO: checking MPI Fortran 2008 interface" >&5 +$as_echo_n "checking MPI Fortran 2008 interface... " >&6; } +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 + pac_cv_mpi_f08="yes"; + { $as_echo "$as_me:$LINENO: result: use mpi_f08. " >&5 +$as_echo " use mpi_f08. " >&6; } + : +else + pac_cv_mpi_f08="no"; + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + { $as_echo "$as_me:$LINENO: result: no. " >&5 +$as_echo " no. " >&6; } +fi +rm -f conftest* + if test x"$pac_cv_mpi_f08" == x"yes" ; then + FDEFINES="$psblas_cv_define_prepend-DMPI_MOD_F08 $FDEFINES"; + else + ac_exeext='' +ac_ext='f90' +ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' { $as_echo "$as_me:$LINENO: checking MPI Fortran interface" >&5 $as_echo_n "checking MPI Fortran interface... " >&6; } cat > conftest.$ac_ext <&6; } rm -rf conftest* FDEFINES="$psblas_cv_define_prepend-DMPI_H $FDEFINES" - fi rm -f conftest* + fi fi diff --git a/configure.ac b/configure.ac index 58d5a819..a1bccd51 100755 --- a/configure.ac +++ b/configure.ac @@ -511,10 +511,14 @@ fi if test x"$pac_cv_serial_mpi" == x"yes" ; then FDEFINES="$psblas_cv_define_prepend-DSERIAL_MPI $psblas_cv_define_prepend-DMPI_MOD $FDEFINES"; else - PAC_FORTRAN_CHECK_HAVE_MPI_MOD( - [FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES"], - [FDEFINES="$psblas_cv_define_prepend-DMPI_H $FDEFINES"] - ) + PAC_FORTRAN_CHECK_HAVE_MPI_MOD_F08() + if test x"$pac_cv_mpi_f08" == x"yes" ; then + FDEFINES="$psblas_cv_define_prepend-DMPI_MOD_F08 $FDEFINES"; + else + PAC_FORTRAN_CHECK_HAVE_MPI_MOD( + [FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES"], + [FDEFINES="$psblas_cv_define_prepend-DMPI_H $FDEFINES"]) + fi fi PAC_ARG_LONG_INTEGERS