From 06587c6e91e234229d2c00274aae9312df282d3f Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 27 Jan 2015 16:24:31 -0500 Subject: [svn-r26057] Fix for: HDFFV-9094 change include 'mpif.h' to module in tests Solution: changed to 'USE mpi' and moved the tests to m4/aclocal_fc.m4 Tested: jam (mpicc, mpif90) --- configure | 6 +++--- configure.ac | 18 +----------------- m4/aclocal_fc.m4 | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/configure b/configure index fc945d0..5215dcf 100755 --- a/configure +++ b/configure @@ -27956,14 +27956,14 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "X$HDF_FORTRAN" = "Xyes"; then - ## Change to the Fortran 90 language + + 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 - ## Try link a simple MPI program. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple MPI-IO Fortran program can be linked" >&5 $as_echo_n "checking whether a simple MPI-IO Fortran program can be linked... " >&6; } cat > conftest.$ac_ext <<_ACEOF @@ -27985,13 +27985,13 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - ## Change to the C language 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 + fi ## Set RUNPARALLEL to mpiexec if not set yet. diff --git a/configure.ac b/configure.ac index 0bdeafd..088ced8 100644 --- a/configure.ac +++ b/configure.ac @@ -2390,23 +2390,7 @@ case "X-$enable_parallel" in AC_MSG_ERROR([unable to link a simple MPI-IO C program])]) if test "X$HDF_FORTRAN" = "Xyes"; then - ## Change to the Fortran 90 language - AC_LANG_PUSH(Fortran) - - ## Try link a simple MPI program. - AC_MSG_CHECKING([whether a simple MPI-IO Fortran program can be linked]) - AC_LINK_IFELSE([ - program main - include 'mpif.h' - integer:: ierr - call mpi_file_open( ierr ) - end], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([unable to link a simple MPI-IO Fortran program])]) - - ## Change to the C language - AC_LANG_POP(Fortran) + PAC_PROG_FC_MPI_CHECK fi ## Set RUNPARALLEL to mpiexec if not set yet. diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 7e909ba..04bcf5f 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -249,3 +249,30 @@ rm -rf conftest* AC_LANG_POP(Fortran) ]) +dnl ---------------------- +dnl Parallel Test Programs +dnl ---------------------- + +dnl Try link a simple MPI program. + +AC_DEFUN([PAC_PROG_FC_MPI_CHECK],[ + +dnl Change to the Fortran 90 language + AC_LANG_PUSH(Fortran) + +dnl Try link a simple MPI program. + AC_MSG_CHECKING([whether a simple MPI-IO Fortran program can be linked]) + AC_LINK_IFELSE([ + PROGRAM main + USE mpi + INTEGER :: ierr + call mpi_file_open( ierr ) + END], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([unable to link a simple MPI-IO Fortran program])]) + +dnl Change to the C language + AC_LANG_POP(Fortran) +]) + -- cgit v0.12