From de52b74788d6f4472b0120ffa873e6f90e5c16c6 Mon Sep 17 00:00:00 2001 From: Irina Date: Wed, 3 Oct 2018 14:12:57 -0600 Subject: [PATCH 1/2] Adding the hdf5 support --- cmake/hdf5.cmake | 34 ++++++++++++++++++++++++++++++++++ cmake/packages.cmake | 1 + 2 files changed, 35 insertions(+) create mode 100644 cmake/hdf5.cmake diff --git a/cmake/hdf5.cmake b/cmake/hdf5.cmake new file mode 100644 index 0000000..1ae42d4 --- /dev/null +++ b/cmake/hdf5.cmake @@ -0,0 +1,34 @@ +#------------------------------------------------------------------------------# +# Copyright (c) 2014 Los Alamos National Security, LLC +# All rights reserved. +#------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------# +# Add HDF5 support. +#------------------------------------------------------------------------------# + +option(ENABLE_HDF5 "Enable HDF5" OFF) + +if(ENABLE_HDF5) + + find_package(HDF5 REQUIRED) + + if(NOT HDF5_FOUND) + message(FATAL_ERROR "HDF5 is required for this build configuration") + endif(NOT HDF5_FOUND) + + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${HDF5_LIBRARY_DIRS}) + + include_directories(${HDF5_INCLUDE_DIRS}) + + + list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_LIBRARIES}) + + message(STATUS "HDF5 found: ${HDF5_FOUND}") + +endif(ENABLE_HDF5) + +#------------------------------------------------------------------------------# +# Formatting options for emacs and vim. +# vim: set tabstop=4 shiftwidth=4 expandtab : +#------------------------------------------------------------------------------# diff --git a/cmake/packages.cmake b/cmake/packages.cmake index 48ac88f..a1e376a 100644 --- a/cmake/packages.cmake +++ b/cmake/packages.cmake @@ -14,6 +14,7 @@ macro(cinch_load_extras) include(boost) include(coverage) include(doxygen) + include(hdf5) if(opt_in_LEGION) include(legion) From fb784ad115aa41e8b090828e37b96c7741469b45 Mon Sep 17 00:00:00 2001 From: Irina Date: Thu, 4 Oct 2018 10:24:43 -0600 Subject: [PATCH 2/2] temporary fix for HDF5 not finding hdf5_cxx_libraries --- cmake/hdf5.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/hdf5.cmake b/cmake/hdf5.cmake index 1ae42d4..4ad7903 100644 --- a/cmake/hdf5.cmake +++ b/cmake/hdf5.cmake @@ -21,8 +21,15 @@ if(ENABLE_HDF5) include_directories(${HDF5_INCLUDE_DIRS}) + list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_LIBRARIES} ${HDF5_CXX_LIBRARIES}) - list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_LIBRARIES}) + if(EXISTS "${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp_debug.so") + list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp_debug.so ) + endif() + + if(EXISTS "${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp.so") + list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp.so ) + endif() message(STATUS "HDF5 found: ${HDF5_FOUND}")