- removed comment
HDF5 won't configure on Fedora
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)
-
reporter -
- removed comment
I still can't use ExternalLibraries/HDF5 on Fedora without this patch. This is probably not ideal.
-
- 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?
-
- 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.
-
- 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.
-
reporter - removed comment
Erik's patch does not work for me. It still says it can't find H5pubconf.h.
-
- 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".
-
reporter - changed status to resolved
- removed comment
Fixed in revision 129
-
- changed status to open
- removed comment
This patch has an error, there's a missing
-a
in theif
statement.Also, other external libraries (e.g.
Boost
) use a different condition for setting theINC_DIRS
,LIB_DIRS
, andLIBS
variable: Autodetection happens depending on the values of theDIR
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 setHDF5_INC_DIRS
,HDF5_LIB_DIRS
, andHDF5_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
, thenHDF5_LIBS
is left empty. -
- changed status to open
- assigned issue to
- removed comment
-
- 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. -
- changed status to open
- removed comment
-
- removed comment
Why are we looking for
H5pubconf.h
here? If we want to know whether HDF5 is installed, we should be looking forhdf5.h
only, since this is the file people will include. We should not be checking for any other files. -
- removed comment
It looks like this is done because H5pubconf.h is parsed to find out whether we need to link with libsz.
-
- 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.
-
- removed comment
Thank you. Erik's patch https://gist.github.com/eschnett/baa8b20fd64eb524c42f should also be applied since it allows the user to specify
HDF5_INC_DIRS
etc directly and prevents the script from overwriting them. This follows the policy the user input supersedes autodetection when the user gives explicit instructions. -
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.
-
reporter - removed comment
Sorry, my mistake. I checked out the release branch by mistake.
-
- removed comment
Steve: Does it work with trunk and both the patches (Erik's https://gist.github.com/eschnett/baa8b20fd64eb524c42f and mine https://trac.einsteintoolkit.org/attachment/ticket/1851/pubconfi.patch) applied? Ian: do you have a patch that makes the error into a warning?
-
- 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.
-
- removed comment
Replying to [comment:9 eschnett]:
This patch has an error, there's a missing
-a
in theif
statement.Also, other external libraries (e.g.
Boost
) use a different condition for setting theINC_DIRS
,LIB_DIRS
, andLIBS
variable: Autodetection happens depending on the values of theDIR
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 setHDF5_INC_DIRS
,HDF5_LIB_DIRS
, andHDF5_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
, thenHDF5_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.
-
- 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).
-
- edited description
- changed status to closed
- Log in to comment
The attached patch respects the user's setting of HDF5_INC_DIRS