[cig-commits] r22946 - seismo/3D/SPECFEM3D_GLOBE/trunk

elliott.sales.de.andrade at geodynamics.org elliott.sales.de.andrade at geodynamics.org
Tue Oct 8 00:13:17 PDT 2013


Author: elliott.sales.de.andrade
Date: 2013-10-08 00:13:17 -0700 (Tue, 08 Oct 2013)
New Revision: 22946

Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/configure
   seismo/3D/SPECFEM3D_GLOBE/trunk/configure.ac
Log:
autoconf: Test for MPI module instead of header.

I was sure that we had changed this already, but anyway, it needs to be
done since we use the module instead of the header.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/configure
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/configure	2013-10-08 07:13:11 UTC (rev 22945)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/configure	2013-10-08 07:13:17 UTC (rev 22946)
@@ -6072,34 +6072,41 @@
 
 
 
-# Generate a Fortran 9x-compatible 'mpif.h', if necessary.
+# Use 'mpi' module or 'mpif.h', as appropriate.  UNFINISHED.
+# The default actions are to create FILENAME that either uses the
+# appropriate module or includes the existing mpif.h.
+# This strategy doesn't play well with "implicit none": whether the
+# generated header must be included before or after "implicit none"
+# depends upon the result of the test!  It might be possible to make
+# "use mpi" always work: simply generate an 'mpi' module if the MPI
+# library doesn't provide one.  The generated module would simply
+# "include 'mpif.h'".
 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
 
 
-ofile="mpif.h"
+ofile=mpif.h
 cfgfile="${ofile}T"
 trap "rm \"$cfgfile\"; exit 1" 1 2 15
 rm -f "$cfgfile"
 
+cit_fc_header=none
 cit_fc_save_fc=$FC
 cit_fc_save_fcflags=$FCFLAGS
 FC=$MPIFC
 FCFLAGS="$FCFLAGS $FLAGS_CHECK"
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpif.h works" >&5
-$as_echo_n "checking whether mpif.h works... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \"use mpi\" works" >&5
+$as_echo_n "checking whether \"use mpi\" works... " >&6; }
 cat > conftest.$ac_ext <<_ACEOF
 
-      program main
+          program main
 
-      include 'mpif.h'
-      integer, parameter :: CUSTOM_MPI_TYPE = MPI_REAL
+      use mpi
       integer ier
       call MPI_INIT(ier)
-      call MPI_BARRIER(MPI_COMM_WORLD,ier)
       call MPI_FINALIZE(ier)
 
       end
@@ -6109,72 +6116,35 @@
 
     { $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; }
-    cit_mpif_h=unknown
-    cit_mpifc_info=`$FC -compile_info 2>/dev/null`
-    for cit_arg in $cit_mpifc_info; do
-        case $cit_arg in
-            */mpif.h) cit_mpif_h="$cit_arg"; break;;
-        esac
-    done
-    if test "$cit_mpif_h" == "unknown"; then
-        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compile a trivial MPI program using $MPIFC
 See \`config.log' for more details" "$LINENO" 5; }
-    fi
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test "$cit_fc_header" != "none"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5
 $as_echo "$as_me: creating $ofile" >&6;}
     cat >"$cfgfile" <<END_OF_HEADER
-! $ofile.  Generated from $cit_mpif_h by configure.
+! $ofile.  Generated by configure.
 
+      $cit_fc_header
+
 END_OF_HEADER
-    grep -v MPI_DISPLACEMENT_CURRENT "$cit_mpif_h" >>"$cfgfile"
     mv -f "$cfgfile" "$ofile" || \
         (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether generated mpif.h works" >&5
-$as_echo_n "checking whether generated mpif.h works... " >&6; }
-    cat > conftest.$ac_ext <<_ACEOF
-
-      program main
-
-      include 'mpif.h'
-      integer, parameter :: CUSTOM_MPI_TYPE = MPI_REAL
-      integer ier
-      call MPI_INIT(ier)
-      call MPI_BARRIER(MPI_COMM_WORLD,ier)
-      call MPI_FINALIZE(ier)
-
-      end
-
-_ACEOF
-if ac_fn_fc_try_compile "$LINENO"; 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; }
-        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compile a trivial MPI program using $MPIFC
-See \`config.log' for more details" "$LINENO" 5; }
-
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
 FC=$cit_fc_save_fc
 FCFLAGS=$cit_fc_save_fcflags
 

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/configure.ac
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/configure.ac	2013-10-08 07:13:11 UTC (rev 22945)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/configure.ac	2013-10-08 07:13:17 UTC (rev 22946)
@@ -164,7 +164,9 @@
 AC_CHECK_HEADER(xmmintrin.h,AC_DEFINE([HAVE_XMMINTRIN],[1],[Define if xmmintrin.h]))
 AC_LANG_POP(C)
 
-CIT_FC_MPI_HEADER([$MPIFC], [$FLAGS_CHECK])
+CIT_FC_MPI_MODULE([mpif.h], [$MPIFC], [$FLAGS_CHECK], [:], [
+    AC_MSG_FAILURE([cannot compile a trivial MPI program using $MPIFC])
+])
 
 # Checks for libraries.
 



More information about the CIG-COMMITS mailing list