Make hdf5 printers and build system more robust to hdf5 version differences#583
Open
Make hdf5 printers and build system more robust to hdf5 version differences#583
Conversation
…sion differences.
Collaborator
Author
|
This is a follow-up to what we discussed in the Core meeting today, @pstoecker, @ChrisJChang and @carlmfe. I added @carlmfe as reviewer, but if anyone else gets to it first, feel free to grab it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds some modifications to
Printers/and to our CMake system, to make the GAMBIT build more robust to issues related to the API changes between different versions of the HDF5 library.Note that we should probably wait for PR #582 to be merged first and pull that small change into this PR before merging this one.
Summary of changes:
Changes to CMake system (cmake/optional.cmake):
HDF5_PREFER_PARALLEL FALSEbefore find_package so a parallel HDF5 install can't be silently preferred. GAMBIT's printers are serial. (MPI coordination is done on the GAMBIT side, not by the parallell HDF5 library.)include_directories(...)toinclude_directories(SYSTEM ...).-DH5_USE_110_API. (When not scoped, this would affect all our build targets, not just the GAMBIT code inPrinters.)check_c_source_compilestest (GAMBIT_HDF5_USABLE) that compiles + links a small program against the discovered HDF5; if it fails, the printers get ditched with a clearhint to use
-DHDF5_ROOT=....This should ensure that we catch the cases where different hdf5 libraries are mixed early in the configure process, rather that giving some cryptic compile/link error deep into the GAMBIT build.-DHDF5_ROOT=...hint to the not-found message.Changes to
Printers/(so we no longer need-DH5_USE_110_API):Printers/include/gambit/Printers/printers/hdf5printer/hdf5tools.hpp: added a small set of macros that mapsGAMBIT_H5L_INFO_T,GAMBIT_H5O_INFO_T,GAMBIT_H5OGET_INFO_BY_NAME(...)and
GAMBIT_H5LITERATEto the version-specific symbols (H5Literate2/H5Oget_info_by_name3/H5O_info2_t/H5L_info2_ton 1.12+, the unversioned forms on 1.10).Printers/src/printers/hdf5printer/hdf5tools.cpp:group_lsno longer uses the deprecatedH5Gget_objinfo/H5G_stat_t(now usesGAMBIT_H5OGET_INFO_BY_NAME+H5O_TYPE_DATASET);lsGroupusesGAMBIT_H5LITERATE;isDataSetuses the macros.Printers/src/printers/hdf5printer/hdf5_combine_tools.cpp:op_func/op_func_auxupdated to use the macros