1. The Enzo Project
  2. Untitled project
  3. enzo-dev
  4. Pull requests

Pull requests

#1 Merged at ee2c164
Repository
enzo-dev-mqk
Branch
week-of-code
Repository
enzo-dev
Branch
week-of-code

HDF5 Hierarchy fix

Author
  1. Michael Kuhlen
Reviewers
Description

In Grid_WriteHierarchyInformationHDF5, I replaced '#ifdef HAVE_HDF5_18' with 'if(HAVE_HDF5_18)', where HAVE_HDF5_18 is now a local variable that is set using H5get_libversion().

It will now compile regardless of HDF5 version.

Update: I found a different (better) solution. In HDF5 1.8.7 they actually implemented a macro H5_VERSION_GE(int maj, int min, int rel), which can be used for exactly my purposes. I simply stole that and put it at the top of Grid_WriteHierarchyInformationHDF5.C. Now it compiles with HDF5 1.6.10, 1.8.4, and 1.8.7.

Comments (3)

  1. John Wise

    Hi Mike, I tried to compile enzo with hdf5 1.6.10, and this change doesn't fix the error because the H5Lcreate_* functions aren't defined in the v1.6 headers. It gives the following compiler errors. Could you find a solution with the appropriate ifdefs that was similar to the previous version?

    Grid_WriteHierarchyInformationHDF5.C: In member function ‘long_int grid::WriteHierarchyInformationHDF5(char*, hid_t, long_int, long_int*, long_int, long_int*, long_int, long_int, FILE*)’:                                                                     
    Grid_WriteHierarchyInformationHDF5.C:189:108: error: ‘H5Lcreate_external’ was not declared in this scope                                                                   
    Grid_WriteHierarchyInformationHDF5.C:218:88: error: ‘H5Lcreate_soft’ was not declared in this scope                                                                        
    Grid_WriteHierarchyInformationHDF5.C:250:88: error: ‘H5Lcreate_soft’ was not declared in this scope  
    
    1. Michael Kuhlen author

      D'oh! I wasn't thinking that the compiler would still need to have those functions defined somewhere, even though they wouldn't be used. Oops.

      I found a different (better) solution. In HDF5 1.8.7 they actually implemented a macro H5_VERSION_GE(int maj, int min, int rel), which can be used for exactly my purposes. I simply stole that and put it at the top of Grid_WriteHierarchyInformationHDF5.C. Now it compiles with HDF5 1.6.10, 1.8.4, and 1.8.7.

      I'm updating the pull request.