]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add support for hdf5
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Oct 2012 20:38:30 +0000 (20:38 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Oct 2012 20:38:30 +0000 (20:38 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27131 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_hdf5.cmake [new file with mode: 0644]
deal.II/cmake/modules/FindHDF5.cmake [new file with mode: 0644]
deal.II/cmake/modules/FindMETIS.cmake
deal.II/include/deal.II/base/config.h.in

diff --git a/deal.II/cmake/configure/configure_hdf5.cmake b/deal.II/cmake/configure/configure_hdf5.cmake
new file mode 100644 (file)
index 0000000..62f8502
--- /dev/null
@@ -0,0 +1,56 @@
+#####
+##
+## Copyright (C) 2012 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## <TODO: Full License information>
+## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
+## version of the LGPL license.
+##
+## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
+##
+#####
+
+#
+# Configuration for the netcdf library:
+#
+
+
+MACRO(FEATURE_HDF5_FIND_EXTERNAL var)
+  FIND_PACKAGE(HDF5)
+
+  IF(HDF5_FOUND)
+      SET(${var} TRUE)
+  ENDIF()
+ENDMACRO()
+
+
+MACRO(FEATURE_HDF5_CONFIGURE_EXTERNAL var)
+  INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${HDF5_LIBRARIES})
+
+  SET(DEAL_II_HAVE_HDF5 TRUE)
+
+  SET(${var} TRUE)
+ENDMACRO()
+
+
+SET(FEATURE_HDF5_CUSTOM_ERROR_MESSAGE TRUE)
+
+
+MACRO(FEATURE_HDF5_ERROR_MESSAGE)
+  MESSAGE(FATAL_ERROR "\n"
+    "Could not find the hdf5 library!\n\n"
+    "Please ensure that the hdf5 library is installed on your computer.\n"
+    "If the library is not at a default location, either provide some hints\n"
+    "for the autodetection:\n"
+    "    $ HDF5_DIR=\"...\" cmake <...>\n"
+    "    $ cmake -DHDF5_DIR=\"...\" <...>\n"
+    "or set the relevant variables by hand in ccmake.\n\n"
+    )
+ENDMACRO()
+
+
+CONFIGURE_FEATURE(HDF5)
+
diff --git a/deal.II/cmake/modules/FindHDF5.cmake b/deal.II/cmake/modules/FindHDF5.cmake
new file mode 100644 (file)
index 0000000..08ac55d
--- /dev/null
@@ -0,0 +1,65 @@
+#####
+##
+## Copyright (C) 2012 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## <TODO: Full License information>
+## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
+## version of the LGPL license.
+##
+## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
+##
+#####
+
+#
+# Try to find the HDF5 library
+#
+# This module exports
+#
+#   HDF5_LIBRARIES
+#   HDF5_INCLUDE_DIRS
+#
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PATH(HDF5_INCLUDE_DIR hdf5.h
+  HINTS
+    ${HDF5_DIR}
+  PATH_SUFFIXES
+    hdf5 include/hdf5 include
+  )
+
+FIND_LIBRARY(HDF5_LIBRARY
+  NAMES hdf5
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+)
+
+FIND_LIBRARY(HDF5_HL_LIBRARY
+  NAMES hdf5_hl
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG
+  HDF5_INCLUDE_DIR
+  HDF5_LIBRARY
+  HDF5_HL_LIBRARY
+  )
+
+SET(HDF5_INCLUDE_DIRS
+  ${HDF5_INCLUDE_DIR}
+  )
+
+SET(HDF5_LIBRARIES
+  ${HDF5_LIBRARY}
+  ${HDF5_HL_LIBRARY}
+  )
+
+IF(HDF5_FOUND)
+  MARK_AS_ADVANCED(
+  HDF5_INCLUDE_DIR
+  HDF5_LIBRARY
+  HDF5_HL_LIBRARY
+  )
+ENDIF()
+
index 285ba645638aabd925015bf341d6178a714dc0c4..48603bd9d8b005d3fd141f83b74088a26fe95e79 100644 (file)
@@ -22,7 +22,7 @@ SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}")
 
 #
 # TODO: Metis is usually pretty self contained. So no external dependencies
-# so far... BUt there could be dependencies on pcre and mpi...
+# so far... But there could be dependencies on pcre and mpi...
 #
 
 FIND_PATH(METIS_INCLUDE_DIR metis.h
index 9c1205a3d065ec73d1c4a4b88e3e30fbd55f9f45..a69a8ea912535a30dd194a61ab214599a2f7a966 100644 (file)
 #cmakedefine HAVE_FUNCTIONPARSER
 
 
+/***************************************
+ * Configured in configure_hdf5.cmake: *
+ **************************************/
+
+/* Defined if deal.II was configured with hdf5 support */
+#cmakedefine DEAL_II_HAVE_HDF5
+
+
 /*****************************************
  * Configured in configure_lapack.cmake: *
  *****************************************/

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.