HDF5 won't configure on Fedora

Issue #1851 closed
Steven R. Brandt created an issue

The problem is that there's no way to tell it the correct place to look for H5pubconf.h (which is /usr/include/mpich-x86_64).

There is an HDF5_INC_DIRS variable, but it's not exposed through configuration.ccl. Even if it's added, it gets overwritten by set_make_vars.

Keyword:

Comments (23)

  1. anonymous
    • removed comment

    I still can't use ExternalLibraries/HDF5 on Fedora without this patch. This is probably not ideal.

  2. Erik Schnetter
    • removed comment

    Yes, the three configuration variables should be exposed to the user. I am surprised this isn't already the case. In fact, there are also other packages where this isn't the case.

    If the user sets these variables, then the script shouldn't change them.

    I propose this patch https://gist.github.com/eschnett/baa8b20fd64eb524c42f instead. Can you test it?

  3. Frank Löffler
    • removed comment

    In addition to accepting these user values, HDF5 should not try to find H5pubconf.h in the first place. Unfortunately, we need to find how the library was compiled, and that information is there. The correct way to do that is to go through H5public.h (which would include H5pubconf.h). But that would mean not parsing a simple file, but at least invoking the preprocessor and parsing it's output. The ideal solution would probably be autoconf-like tests, but the question is whether it is worth going so far.

  4. Frank Löffler
    • removed comment

    Another alternative would be to just disregard installations that don't use pkg-config. That's exactly the reason why pkg-config exists. Of course, we don't really want to do that with a 'giant' like Fedora, even if they should fix it by providing a pkg-config file for HDF5.

  5. Steven R. Brandt reporter
    • removed comment

    Erik's patch does not work for me. It still says it can't find H5pubconf.h.

  6. Erik Schnetter
    • removed comment

    If the user provides all settings, then we should blindly accept them. If the user says "these are the libraries against which you should link", then there's no point in saying "ooh, but I wanted to see whether this other library might also be necessary, but then I couldn't find out, so I rather abort".

  7. Erik Schnetter
    • changed status to open
    • removed comment

    This patch has an error, there's a missing -a in the if statement.

    Also, other external libraries (e.g. Boost) use a different condition for setting the INC_DIRS, LIB_DIRS, and LIBS variable: Autodetection happens depending on the values of the DIR variable (and independent of the three specific variables), and if any of the variables is unset, it is set to the autodetected value.

    This has the following advantage: If you set e.g. HDF5_DIR to a specific value, then this value is used to set HDF5_INC_DIRS, HDF5_LIB_DIRS, and HDF5_LIBS. If any of these three values is wrong, you can overwrite it, without affecting the values of the other variables. This has been like this in Cactus for a long time.

    As is, if you set HDF5_INC_DIRS, then HDF5_LIBS is left empty.

  8. Roland Haas
    • removed comment

    I added a short patch that lets users at least compile by looking for more than the single filename. The HDF5 detection script is in too much of a flux for me to attempt a solution that lets me specify HDF5_LIBS etc directly and skips the auto-check.

  9. Erik Schnetter
    • removed comment

    Why are we looking for H5pubconf.h here? If we want to know whether HDF5 is installed, we should be looking for hdf5.h only, since this is the file people will include. We should not be checking for any other files.

  10. Ian Hinder
    • removed comment

    It looks like this is done because H5pubconf.h is parsed to find out whether we need to link with libsz.

  11. Ian Hinder
    • removed comment

    I propose to change this error into a warning that the compression libraries won't be detected automatically, and to then skip these checks. This way, the user will still be able to add the required libraries manually using variables in the optionlist. This should fix the inability to build the ET on Fedora, Cent OS, Red Hat and Scientific Linux, since we can add the required libraries to fedora.cfg. I would then add Roland's patch, which looks for both filenames, and should allow the auto-detection to work. I am testing this now.

  12. Steven R. Brandt reporter
    • removed comment

    I just checked out Cactus, and HDF5 still stops the build because it can't find H5pubconf.h. Even with Erik's patch. While Erik's patch does add the HDF5 variables (e.g. HDF5_INC_DIRS, etc.) to the configuration.ccl and prevents them from getting over-written, the check on line 59 of detect.sh still succeeds, find_lib is still called on line 60, and the build is aborted because H5pubconf.h is not found. So while the HDF5 variables do get set, it doesn't matter.

    My patch included additional checks on line 59 to see if any of the HDF5 variables were set, and avoided calling find_lib if it were so. Some mechanism to avoid calling find_lib is needed.

  13. Ian Hinder
    • removed comment

    I attach the two patches that I have locally against current trunk. I haven't followed this ticket in a while, so I'm not sure what the current status is.

  14. Roland Haas
    • removed comment

    Replying to [comment:9 eschnett]:

    This patch has an error, there's a missing -a in the if statement.

    Also, other external libraries (e.g. Boost) use a different condition for setting the INC_DIRS, LIB_DIRS, and LIBS variable: Autodetection happens depending on the values of the DIR variable (and independent of the three specific variables), and if any of the variables is unset, it is set to the autodetected value.

    This has the following advantage: If you set e.g. HDF5_DIR to a specific value, then this value is used to set HDF5_INC_DIRS, HDF5_LIB_DIRS, and HDF5_LIBS. If any of these three values is wrong, you can overwrite it, without affecting the values of the other variables. This has been like this in Cactus for a long time.

    As is, if you set HDF5_INC_DIRS, then HDF5_LIBS is left empty.

    ExternalLibraries are inconsistent at best in how they handle this. I checked MPI (perl) and GSL (monolithic shell) and both assume a full manual configuration if one of the LIBS variables is set. For now I would keep it this way and make all libraries uniform once we use a common framework.

  15. Roland Haas
    • changed status to resolved
    • removed comment

    I applied patches 0001-detect.sh-Treat-failure-to-find-H5pubconf.h-as-a-war.patch and 0002-detect.sh-Search-for-more-than-one-H5pubconf-file.patch but not Erik's gist patch since current trunk already contains similar functionality that is a bit closer to other ExternalLibraries (all of which are inconsistent with each other it seems).

    Please re-open this ticket if the error persists (though I think there is an emai lsomewhere that HDF5 now builds on fedora).

  16. Log in to comment