From 8a8df8fbb03eba04ed536361ec02c3e1cdbfde07 Mon Sep 17 00:00:00 2001 From: Mark Berrill Date: Wed, 3 Nov 2021 11:05:50 -0400 Subject: [PATCH] Fixing issues building with HDF5 and without Silo/NetCDF --- CMakeLists.txt | 1 + IO/HDF5Writer.cpp | 2 +- IO/SiloWriter.cpp | 4 +++- analysis/PointList.h | 3 --- cmake/libraries.cmake | 12 +++++++----- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17e127bc..1a55c9f1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,7 @@ ENDIF() IF ( NOT ONLY_BUILD_DOCS ) CONFIGURE_MPI() # MPI must be before other libraries CONFIGURE_MIC() + CONFIGURE_HDF5() CONFIGURE_NETCDF() CONFIGURE_SILO() CONFIGURE_LBPM() diff --git a/IO/HDF5Writer.cpp b/IO/HDF5Writer.cpp index 3fca33bd..577e59c5 100644 --- a/IO/HDF5Writer.cpp +++ b/IO/HDF5Writer.cpp @@ -274,7 +274,7 @@ std::vector writeMeshesHDF5( const std::vector writeMeshesHDF5( - const std::vector &, const std::string &, IO::FileFormat, int ); + const std::vector &, const std::string &, IO::FileFormat, int ) { return std::vector(); } diff --git a/IO/SiloWriter.cpp b/IO/SiloWriter.cpp index c2e8df26..350f60d5 100644 --- a/IO/SiloWriter.cpp +++ b/IO/SiloWriter.cpp @@ -245,7 +245,9 @@ std::vector writeMeshesSilo( { return std::vector(); } -void writeSiloSummary( const std::vector &, const std::string & ); +void writeSiloSummary( const std::vector &, const std::string & ) +{ +} #endif diff --git a/analysis/PointList.h b/analysis/PointList.h index 2ea39345..28e2e7a0 100644 --- a/analysis/PointList.h +++ b/analysis/PointList.h @@ -6,9 +6,6 @@ struct LBPM_Point { LBPM_Point() : x(0.0), y(0.0), z(0.0) {} LBPM_Point(double xv,double yv,double zv) : x(xv), y(yv), z(zv) {} - LBPM_Point(const LBPM_Point& rhs): x(rhs.x), y(rhs.y), z(rhs.z) {} - //Point& operator=(const Point& rhs) { this->x=rhs.x; this->y=rhs.y; this->z=rhs.z; return *this; } - //~Point() {} double x,y,z; }; typedef LBPM_Point Point; diff --git a/cmake/libraries.cmake b/cmake/libraries.cmake index f899c289..567385ee 100644 --- a/cmake/libraries.cmake +++ b/cmake/libraries.cmake @@ -103,12 +103,12 @@ ENDMACRO() # Macro to find and configure hdf5 MACRO ( CONFIGURE_HDF5 ) CHECK_ENABLE_FLAG( USE_HDF5 0 ) - IF ( USE_HDF5 ) - # Check if we specified the silo directory + IF ( USE_HDF5 AND NOT FOUND_HDF5 ) + # Check if we specified the hdf5 directory IF ( HDF5_DIRECTORY ) VERIFY_PATH ( ${HDF5_DIRECTORY} ) INCLUDE_DIRECTORIES ( ${HDF5_DIRECTORY}/include ) - SET ( HDF5_INCLUDE ${HDF5_DIRECTORY}/include ) + SET( HDF5_INCLUDE ${HDF5_DIRECTORY}/include ) FIND_LIBRARY ( HDF5_LIB NAMES hdf5 PATHS ${HDF5_DIRECTORY}/lib NO_DEFAULT_PATH ) FIND_LIBRARY ( HDF5_HL_LIB NAMES hdf5_hl PATHS ${HDF5_DIRECTORY}/lib NO_DEFAULT_PATH ) ELSE() @@ -118,6 +118,8 @@ MACRO ( CONFIGURE_HDF5 ) ${HDF5_HL_LIB} ${HDF5_LIB} ) + SET( FOUND_HDF5 TRUE ) + SET( EXTERNAL_LIBS ${HDF5_LIBS} ${EXTERNAL_LIBS} ) ADD_DEFINITIONS ( -DUSE_HDF5 ) MESSAGE( "Using hdf5" ) MESSAGE( " ${HDF5_LIB}" ) @@ -151,7 +153,7 @@ MACRO( CONFIGURE_NETCDF ) ELSE() MESSAGE( FATAL_ERROR "Default search for netcdf is not yet supported. Use -D NETCDF_DIRECTORY=" ) ENDIF() - SET( EXTERNAL_LIBS ${NETCDF_LIBS} ${HDF5_LIBS} ${EXTERNAL_LIBS} ) + SET( EXTERNAL_LIBS ${NETCDF_LIBS} ${EXTERNAL_LIBS} ) ADD_DEFINITIONS ( -DUSE_NETCDF ) MESSAGE( "Using netcdf" ) MESSAGE( " ${NETCDF_LIBS}" ) @@ -179,7 +181,7 @@ MACRO ( CONFIGURE_SILO ) SET ( SILO_LIBS ${SILO_LIB} ) - SET( EXTERNAL_LIBS ${SILO_LIBS} ${HDF5_LIBS} ${EXTERNAL_LIBS} ) + SET( EXTERNAL_LIBS ${SILO_LIBS} ${EXTERNAL_LIBS} ) ADD_DEFINITIONS ( -DUSE_SILO ) MESSAGE( "Using silo" ) MESSAGE( " ${SILO_LIB}" )