From d0533f32357a078f8765caff293be530b3ed520d Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 1 Nov 2018 14:32:00 +0100 Subject: [PATCH 1/4] Fixup for supporting system installed HDF5 and Eigen --- external/external_build.cmake | 7 +++++-- src/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/external/external_build.cmake b/external/external_build.cmake index 48ce837..5032b35 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -25,7 +25,7 @@ MACRO(CHECK_CHANGE_STATE VAR) ENDMACRO(CHECK_CHANGE_STATE) CHECK_CHANGE_STATE(INTERNAL_BOOST Boost_LIBRARIES Boost_INCLUDE_DIRS) -CHECK_CHANGE_STATE(INTERNAL_EIGEN EIGEN3_INCLUDE_DIRS) +CHECK_CHANGE_STATE(INTERNAL_EIGEN EIGEN3_INCLUDEDIR) CHECK_CHANGE_STATE(INTERNAL_GSL GSL_LIBRARY GSL_CBLAS_LIBRARY GSL_INCLUDE) CHECK_CHANGE_STATE(INTERNAL_HDF5 HDF5_INCLUDE_DIR HDF5_LIBRARIES HDF5_CXX_LIBRARIES @@ -338,7 +338,7 @@ IF (INTERNAL_EIGEN) -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ) - SET(EIGEN3_INCLUDE_DIRS ${EXT_INSTALL}/include/eigen3) + SET(EIGEN3_INCLUDEDIR ${EXT_INSTALL}/include/eigen3) ELSE (INTERNAL_EIGEN) if(DEFINED EIGEN_PATH) @@ -352,6 +352,9 @@ ELSE (INTERNAL_EIGEN) if (NOT EIGEN3_FOUND) cmessage(CWARNING "Eigen library not found") else() + IF(EIGEN3_STATIC_INCLUDE_DIRS) + SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_STATIC_INCLUDE_DIRS}) + ENDIF() cmessage(STATUS "Found EIGEN3 in ${EIGEN3_INCLUDE_DIRS}") endif() ENDIF(INTERNAL_EIGEN) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b9c1dc2..bc7ae98 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,7 +40,7 @@ if (HDF5_FOUND) ) target_include_directories(CosmoHDF5 BEFORE PRIVATE ${HDF5_INCLUDE_DIR}) else(HDF5_FOUND) - add_library(CosmoHdf5 OBJECT + add_library(CosmoHDF5 OBJECT loadFlash_dummy.cpp ) endif (HDF5_FOUND) From b24177484ecf288afdbb57241464e73aec94aa4a Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 1 Nov 2018 15:38:41 +0100 Subject: [PATCH 2/4] Add another alias for include dirs --- external/external_build.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/external/external_build.cmake b/external/external_build.cmake index 5032b35..a38fc1d 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -128,6 +128,7 @@ else (INTERNAL_HDF5) endif() endforeach() cmessage(STATUS "HDF5 libpath: ${HDF5_BIN_DIR}") + SET(HDF5_INCLUDE_DIR ${HDF5_INCLUDE_DIRS}) else() cmessage(STATUS "Found HDF5 cmake config.") cmessage(STATUS "HDF5_C_STATIC_LIBRARY : ${HDF5_C_STATIC_LIBRARY}") From e0ce86ae187fe3f106494a78d4f69b57be3324d6 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 1 Nov 2018 18:14:35 +0100 Subject: [PATCH 3/4] Attempt to fix version detection --- src/hdf5_array.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hdf5_array.hpp b/src/hdf5_array.hpp index 2e73b9a..693566a 100644 --- a/src/hdf5_array.hpp +++ b/src/hdf5_array.hpp @@ -51,7 +51,7 @@ knowledge of the CeCILL license and that you accept its terms. #include namespace CosmoTool { -#if (H5_VERS_MAJOR == 1) && (H5_VERS_MINOR <= 8) +#if H5_VERSION_GE(1,10,0) typedef H5::CommonFG H5_CommonFileGroup; #else typedef H5::Group H5_CommonFileGroup; From ec4e895fd80a1d0f20ae825b89f2e06987902dca Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 2 Nov 2018 08:02:26 +0100 Subject: [PATCH 4/4] Fixed minimum version number for HDF5 class hierarchy --- src/hdf5_array.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hdf5_array.hpp b/src/hdf5_array.hpp index 693566a..f6d2f29 100644 --- a/src/hdf5_array.hpp +++ b/src/hdf5_array.hpp @@ -51,7 +51,7 @@ knowledge of the CeCILL license and that you accept its terms. #include namespace CosmoTool { -#if H5_VERSION_GE(1,10,0) +#if H5_VERSION_GE(1,8,20) typedef H5::CommonFG H5_CommonFileGroup; #else typedef H5::Group H5_CommonFileGroup;