NCAR / lrose-core

Core C/C++ code for LROSE.
https://www.eol.ucar.edu/content/lidar-radar-open-software-environment
Other
92 stars 51 forks source link

radx fails to build with hdf5 1.10.1 #8

Closed iMichka closed 7 years ago

iMichka commented 7 years ago

Hi

I am one of the homebrew-science package managers. We just updated to the latest version of hdf5 (1.10.1). It seems that radx fails to build on Mac and on Linux with that version of hdf5.

Here is the error we are getting:

Gamic/GamicHdf5RadxFile.cc:1067:25: error: cannot initialize a parameter of type 'attr_operator_t' (aka 'void (*)(H5::H5Object &, const basic_string<char, char_traits<char>, allocator<char> >, void *)') with an lvalue of type 'void (H5::H5Location &, const std::string, void *)' (aka 'void (H5::H5Location &, const basic_string<char, char_traits<char>, allocator<char> >, void *)'): type mismatch at 1st parameter ('H5::H5Object &' vs 'H5::H5Location &')
  extended.iterateAttrs(Hdf5Utils::appendAttrNames, NULL, &attrNames);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/H5Object.h:76:42: note: passing argument to parameter 'user_op' here
        int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL);
                                         ^
1 error generated.
make[3]: *** [Gamic/GamicHdf5RadxFile.lo] Error 1

Here is the related pull request: https://github.com/Homebrew/homebrew-science/pull/5646. As you can see I also updated radx to the latest version and adapted the formula, in the hope this would maybe already be fixed. Maybe you could have a look, before we need to revert to an older version of hdf5. Thanks in advance.

iMichka commented 7 years ago

I was able to compile using the following patch: https://raw.githubusercontent.com/Homebrew/formula-patches/3124ede999c9ffd700652d20f0455c97512f84a3/radx/radx-hdf5-20170315.diff?full_index=1

There are some macro redefinitions for H5Location and H5Object on top of the header files, but this does not seem to work correctly. I did not investigate any more but we have a workaround on our side; it would be great if you could have a look and make a proper fix for this. Thanks!

rpelorosso commented 7 years ago

Hello @iMichka, I'm sorry to bother you, but could you please tell me what version of gcc did you use? I'm having a hard time trying to compile this suite.

iMichka commented 7 years ago

That was clang/llvm on mac (Xcode 8 I think), and gcc 4.8 on Linux. All the builds passed with this patch.

ilovezfs commented 7 years ago

@mike-dixon it seems a new version was released that still has this issue. Any chance you can take a look at fixing this so that radx works with the current version of HDF5? I'm rebasing the patch but that's not something we can do indefinitely.

mike-dixon commented 7 years ago

Fixed. Changed Ncxx and Radx libraries to use getNumAttr(), and H5Aopen_idx(), instead of iterateAttrs() to iterate through attributes. Removed usage of H5Location, now uses H5Object everywhere"