[cmake-developers] [PATCH] Fix a few issues in FindHDF5 module

Paul Romano paul.k.romano at gmail.com
Mon Aug 31 04:47:56 EDT 2015


I'd like to offer the attached patch for consideration that fixes a number
of issues with FindHDF5.cmake. The issues are as follows:

1. Searching for libraries related to the HL and Fortran_HL components is a
bit broken at the moment; for example, if you specify the Fortran_HL
component, HDF5_INCLUDE_DIRS ends up including
HDF5_Fortran_HL_INCLUDE_DIR-NOTFOUND, which makes HDF5_INCLUDE_DIRS
evaluate to false, thus causing the overall find_package to fail. The
debian maintainers actually have included a two-line patch to fix this
going all the way back to pre-3.0 for their cmake-data package. That patch
is included here.

2. Even with the aforementioned patch, specifying the Fortran_HL component
doesn't include the hdf5_hl library, which results in a bunch of undefined
references at link time. I've added that library to the list of libraries
to be searched for Fortran_HL.

3. In issue #15527, it is reported that when a serial and parallel
installation of HDF5 are installed alongside one another, the serial
version is always preferred even if you specify the parallel version in
HDF5_ROOT. This is a result of find_program searching for h5cc and h5pcc
simulataneously, with h5cc listed first. In the attached patch, one can now
set the HDF5_PREFER_PARALLEL variable which tells FindHDF5 to search for
h5pcc first rather than h5cc.

Best regards,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150831/119540d0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-FindHDF5-Fix-HL-compile-line-and-add-means-of-prefer.patch
Type: text/x-patch
Size: 4139 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150831/119540d0/attachment.bin>


More information about the cmake-developers mailing list