[MOAB-dev] r4503 - MOAB/trunk/config

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Feb 16 12:17:46 CST 2011


Author: kraftche
Date: 2011-02-16 12:17:46 -0600 (Wed, 16 Feb 2011)
New Revision: 4503

Modified:
   MOAB/trunk/config/hdf5.m4
   MOAB/trunk/config/netcdf.m4
Log:
Misc configure changes/cleanups:
 o Try harder to get configure correct for netcdf that requires hdf5:
     Common logic to find HDF5 libraries that can be used to 
     get the correct HDF5 lib list if netcdf requires it but
     --with-hdf5 was not specified.
 o Consolidate some logic duplicated in netcdf and pnetcdf tests for
     checking fixed limits for ExodusII compatability
 o Don't bother trying to check for above limits if (p)netcdf.h was
     not found.
 o Do not check for pnetcdf if neither --with-mpi nor --with-pnetcdf
    is specified.  Fail earlier if the latter but not the former is 
    specified.


Modified: MOAB/trunk/config/hdf5.m4
===================================================================
--- MOAB/trunk/config/hdf5.m4	2011-02-16 18:15:03 UTC (rev 4502)
+++ MOAB/trunk/config/hdf5.m4	2011-02-16 18:17:46 UTC (rev 4503)
@@ -1,4 +1,53 @@
+
 #######################################################################################
+# Helper function for FATHOM_CHECK_HDF5 and FATHOM_CHECK_NETCDF
+# If HAVE_LIB_HDF5 == yes, then does nothing.
+# Otherwise sets HAVE_LIB_HDF5 to yes or no depending on whether or not
+# HDF5 libraries are detected and sets HDF5_LIBS
+# Respects caller's LDFLAGS, CPPFLAGS, and LIBS.  Caller should set appropriately.
+# Respections optional HDF5_LIBNAME uses to specify alternate library name.  If
+# not specified, will be set to -lhdf5
+#######################################################################################
+AC_DEFUN([FATHOM_DETECT_HDF5_LIBS],[
+
+ # if we've already done this check, then don't do it again
+if test "xyes" != "x$HAVE_LIB_HDF5"; then
+    # Check for IBM parallel IO library
+  if test "x$WITH_MPI" != "xno"; then
+    AC_CHECK_LIB([gpfs],[gpfs_stat],[HDF5_LIBS="-lgpfs $HDF5_LIBS"])
+  fi
+  
+  test "x" != "x$HDF5_LIBNAME" || HDF5_LIBNAME=hdf5
+  
+  HAVE_LIB_HDF5=no
+  AC_CHECK_LIB( [$HDF5_LIBNAME], [H5Fopen], [HAVE_LIB_HDF5=yes] )
+  if test $HAVE_LIB_HDF5 = no; then
+    if test $HAVE_ZLIB = yes; then
+      unset "ac_cv_lib_${HDF5_LIBNAME}_H5Fopen"
+      unset "ac_cv_lib_${HDF5_LIBNAME}___H5Fopen"
+      AC_CHECK_LIB( [${HDF5_LIBNAME}], [H5Fopen], [HAVE_LIB_HDF5=yes; HDF5_LIBS="$HDF5_LIBS -lz"], [], [-lz] )
+    fi
+  fi
+  if test $HAVE_LIB_HDF5 = no; then
+    if test $HAVE_SZIP = yes; then
+      unset "ac_cv_lib_${HDF5_LIBNAME}_H5Fopen"
+      unset "ac_cv_lib_${HDF5_LIBNAME}___H5Fopen"
+      AC_CHECK_LIB( [$HDF5_LIBNAME], [H5Fopen], [HAVE_LIB_HDF5=yes; HDF5_LIBS="$HDF5_LIBS -lsz"], [], [-lsz] )
+    fi
+  fi
+  if test $HAVE_LIB_HDF5 = no; then
+    if test $HAVE_SZIP = yes; then
+      if test $HAVE_ZLIB = yes; then
+        unset "ac_cv_lib_${HDF5_LIBNAME}_H5Fopen"
+        unset "ac_cv_lib_${HDF5_LIBNAME}___H5Fopen"
+        AC_CHECK_LIB( [$HDF5_LIBNAME], [H5Fopen], [HAVE_LIB_HDF5=yes; HDF5_LIBS="$HDF5_LIBS -lsz -lz"], [], [-lz -lsz] )
+      fi
+    fi
+  fi


More information about the moab-dev mailing list