[MOAB-dev] r5218 - in MOAB/trunk: . config

tautges at mcs.anl.gov tautges at mcs.anl.gov
Wed Nov 16 18:32:00 CST 2011


Author: tautges
Date: 2011-11-16 18:32:00 -0600 (Wed, 16 Nov 2011)
New Revision: 5218

Modified:
   MOAB/trunk/config/compiler.m4
   MOAB/trunk/configure.ac
Log:
Adding logic to detect when -fcray-pointer is needed, stolen from MPICH2.



Modified: MOAB/trunk/config/compiler.m4
===================================================================
--- MOAB/trunk/config/compiler.m4	2011-11-16 21:54:13 UTC (rev 5217)
+++ MOAB/trunk/config/compiler.m4	2011-11-17 00:32:00 UTC (rev 5218)
@@ -543,3 +543,110 @@
 esac
 AC_MSG_RESULT([$cc_compiler:$host_cpu])
 ]) # end FATHOM_CC_FLAGS
+
+
+#######################################################################################
+# Check for Fortran compiler-specific flags.
+#######################################################################################
+
+dnl PAC_PROG_F77_CRAY_POINTER - Check if Fortran 77 supports Cray-style pointer.
+dnl                             If so, set pac_cv_prog_f77_has_pointer to yes
+dnl                             and find out if any extra compiler flag is
+dnl                             needed and set it as CRAYPTR_FFLAGS.
+dnl                             i.e. CRAYPTR_FFLAGS is meaningful only if
+dnl                             pac_cv_prog_f77_has_pointer = yes.
+dnl
+dnl Synopsis:
+dnl   PAC_PROG_F77_CRAY_POINTER([action-if-true],[action-if-false])
+dnl D*/
+AC_DEFUN([PAC_PROG_F77_CRAY_POINTER],[
+AC_CACHE_CHECK([whether Fortran 77 supports Cray-style pointer],
+pac_cv_prog_f77_has_pointer,[
+AC_LANG_PUSH([Fortran 77])
+AC_LANG_CONFTEST([
+    AC_LANG_PROGRAM([],[
+        integer M
+        pointer (MPTR,M)
+        data MPTR/0/
+    ])
+])
+saved_FFLAGS="$FFLAGS"
+pac_cv_prog_f77_has_pointer=no
+CRAYPTR_FFLAGS=""
+for ptrflag in '' '-fcray-pointer' ; do
+    FFLAGS="$saved_FFLAGS $ptrflag"
+    AC_COMPILE_IFELSE([], [
+        pac_cv_prog_f77_has_pointer=yes
+        CRAYPTR_FFLAGS="$ptrflag"
+        break
+    ])
+done
+dnl Restore FFLAGS first, since user may not want to modify FFLAGS
+FFLAGS="$saved_FFLAGS"
+dnl remove conftest after ac_lang_conftest
+rm -f conftest.$ac_ext
+AC_LANG_POP([Fortran 77])


More information about the moab-dev mailing list