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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Aug 9 17:27:32 CDT 2011


Author: kraftche
Date: 2011-08-09 17:27:32 -0500 (Tue, 09 Aug 2011)
New Revision: 5087

Modified:
   MOAB/trunk/config/hdf5.m4
Log:
HDF5 library may also require -lpthread Makes configure with LDFLAGS=-static work as expected for me

Modified: MOAB/trunk/config/hdf5.m4
===================================================================
--- MOAB/trunk/config/hdf5.m4	2011-08-09 22:12:58 UTC (rev 5086)
+++ MOAB/trunk/config/hdf5.m4	2011-08-09 22:27:32 UTC (rev 5087)
@@ -1,3 +1,10 @@
+AC_DEFUN([FATHOM_HDF5_LIBS_HELPER],[
+if test $HAVE_LIB_HDF5 = no; 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 $1"], [], [$1] )
+fi
+])
 
 #######################################################################################
 # Helper function for FATHOM_CHECK_HDF5 and FATHOM_CHECK_NETCDF
@@ -20,30 +27,19 @@
   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
+  FATHOM_HDF5_LIBS_HELPER
+  if test $HAVE_ZLIB = yes; then
+    FATHOM_HDF5_LIBS_HELPER([-lz])
+    FATHOM_HDF5_LIBS_HELPER([-lz -lpthread])
+  fi
+  if test $HAVE_SZIP = yes; then
+    FATHOM_HDF5_LIBS_HELPER([-lsz])
+    FATHOM_HDF5_LIBS_HELPER([-lsz -lpthread])
     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] )
+      FATHOM_HDF5_LIBS_HELPER([-lsz -lz])
+      FATHOM_HDF5_LIBS_HELPER([-lsz -lz -lpthread])
     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


More information about the moab-dev mailing list