[cig-commits] r17260 - in short/3D/PyLith/trunk: . unittests/libtests/meshio

brad at geodynamics.org brad at geodynamics.org
Mon Oct 11 17:43:08 PDT 2010


Author: brad
Date: 2010-10-11 17:43:08 -0700 (Mon, 11 Oct 2010)
New Revision: 17260

Modified:
   short/3D/PyLith/trunk/configure.ac
   short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
Log:
Added switch to enable/disable support for HDF5 output.

Modified: short/3D/PyLith/trunk/configure.ac
===================================================================
--- short/3D/PyLith/trunk/configure.ac	2010-10-11 21:16:31 UTC (rev 17259)
+++ short/3D/PyLith/trunk/configure.ac	2010-10-12 00:43:08 UTC (rev 17260)
@@ -70,6 +70,15 @@
 	[enable_tetgen=no])
 AM_CONDITIONAL([ENABLE_TETGEN], [test "$enable_tetgen" = yes])
 
+# PETSc w/HDF5
+AC_ARG_ENABLE([hdf5],
+    [AC_HELP_STRING([--enable-hdf5],
+        [enable output to HDF5 files via PETSc @<:@default=no@:>@])],
+	[enable_hdf5=yes
+	CPPFLAGS="-DENABLE_HDF5 $CPPFLAGS"; export CPPFLAGS],
+	[enable_hdf5=no])
+AM_CONDITIONAL([ENABLE_HDF5], [test "$enable_hdf5" = yes])
+
 # MEMORY LOGGING
 AC_ARG_ENABLE([memory_logging],
     [AC_HELP_STRING([--enable-memory-logging],
@@ -184,6 +193,24 @@
   ])
 fi
 
+# HDF5
+if test "$enable_hdf5" = "yes" ; then
+  AC_REQUIRE_CPP
+  AC_LANG(C++)
+  CPPFLAGS="$PETSC_INCLUDE $PETSC_CXX_INCLUDE $CPPFLAGS"  
+  AC_CHECK_HEADER([hdf5.h], [], [
+    AC_MSG_ERROR([HDF5 header not found.])
+  ])
+  AC_MSG_CHECKING([for H5Fopen in -lhdf5])
+  AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM([[#include <hdf5.h>]],
+	             [[H5Fopen("test.h5", H5F_ACC_TRUNC, H5P_DEFAULT);]])],
+    [AC_MSG_RESULT(yes)],
+    [AC_MSG_RESULT(no)
+     AC_MSG_ERROR([hdf5 library not found.])
+  ])
+fi
+
 # PROJ4
 AC_CHECK_LIB(proj, pj_init_plus, [
   AC_CHECK_HEADER([proj_api.h], [], [

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am	2010-10-11 21:16:31 UTC (rev 17259)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am	2010-10-12 00:43:08 UTC (rev 17260)
@@ -59,9 +59,6 @@
 	TestDataWriterVTKSubMeshQuad4.cc \
 	TestDataWriterVTKSubMeshTet4.cc \
 	TestDataWriterVTKSubMeshHex8.cc \
-	TestDataWriterHDF5.cc \
-	TestDataWriterHDF5Mesh.cc \
-	TestDataWriterHDF5MeshHex8.cc \
 	TestOutputManager.cc \
 	TestOutputSolnSubset.cc \
 	TestDataWriterVTKFaultMesh.cc \
@@ -106,9 +103,6 @@
 	TestDataWriterVTKBCMeshQuad4.hh \
 	TestDataWriterVTKBCMeshTet4.hh \
 	TestDataWriterVTKBCMeshHex8.hh \
-	TestDataWriterHDF5.hh \
-	TestDataWriterHDF5Mesh.hh \
-	TestDataWriterHDF5MeshHex8.hh \
 	TestMeshIO.hh \
 	TestMeshIOAscii.hh \
 	TestMeshIOLagrit.hh \
@@ -219,7 +213,21 @@
   testmeshio_LDADD += -lnetcdf_c++ -lnetcdf
 endif
 
+if ENABLE_HDF5
+  testmeshio_SOURCES += \
+	TestDataWriterHDF5.cc \
+	TestDataWriterHDF5Mesh.cc \
+	TestDataWriterHDF5MeshHex8.cc
 
+  noinst_HEADERS += \
+	TestDataWriterHDF5.hh \
+	TestDataWriterHDF5Mesh.hh \
+	TestDataWriterHDF5MeshHex8.hh
+
+  testmeshio_LDADD += -lhdf5
+endif
+
+
 noinst_tmp = \
 	mesh1D.txt \
 	mesh1Din2D.txt \



More information about the CIG-COMMITS mailing list