[CMake] Status of FindHDF5.cmake in CMake?
Will Dicharry
wdicharry at stellarscience.com
Mon Jun 6 10:53:05 EDT 2011
Tim Gallagher wrote:
> We've run into another issue with the way FindHDF5 works.
>
> On Cray systems, h5fc -show gives:
>
> ifort -fPIC -I/opt/cray/hdf5/1.8.5.0/hdf5-intel/include -L/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib /opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5hl_fortran.a /opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5_hl.a /opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5_fortran.a /opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5.a -lz -lm -Wl,-rpath -Wl,/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib -L/usr/lib64
>
> The FindHDF5 complains it can't find the libraries because it looks for the -l* portions and doesn't find the lines giving the .a files.
>
> I will try to think of a general way to make this work, but I'm not very well versed in cmake. So if anybody has any suggestions or knows how to fix it, we'd sure appreciate it!
>
>
This will only work for a Unix link line, but most of the compile line
reading stuff will only work on a Unix system anyway. But, the regular
expression
\(\/[^ \/]*\)*.\.a
Will match full paths to static libraries on the link line. I could add
something to the _HDF5_parse_compile_line macro to match that expression
and append those paths to the candidate set. Do you think that would
solve the problem?
> Tim
>
> ----- Original Message -----
> From: "Tim Gallagher" <tim.gallagher at gatech.edu>
> To: cmake at cmake.org
> Sent: Friday, May 20, 2011 6:07:50 PM
> Subject: Re: [CMake] Status of FindHDF5.cmake in CMake?
>
> Will,
>
> Sorry for the delay in responding. We tested the FindHDF5 you attached and it correctly located the Fortran libraries.
>
> Thanks for including it in the updated version!
>
> Tim
>
> ----- Original Message -----
> From: "Will Dicharry" <wdicharry at stellarscience.com>
> To: "J.S. van Bethlehem" <j.s.van.bethlehem at astro.rug.nl>
> Cc: cmake at cmake.org
> Sent: Friday, May 20, 2011 5:32:16 PM
> Subject: Re: [CMake] Status of FindHDF5.cmake in CMake?
>
> J.S. van Bethlehem wrote:
>
>> Hej Will,
>> I'm not sure if this is the proper way to reply and I haven't checked
>> your second mail with the attachment. But I think in #3 you're
>> definitely doing something wrong. It took me quite a while to figure
>> out, because the documentation is rather sparse, but whenever there is
>> a hdf5-config.cmake file, you should not read that from a Find*.cmake
>> file. Whenever there is such a file present, what should happen is
>> that CMake finds it and reads it and that's that.
>> Even more precise: whenever a user writes find_package(HDF5) and the
>> hdf5-config.cmake exists, CMake will read that file and will NOT go
>> look for FindHDF5.cmake. The hdf5-config.cmake should then explicitly
>> set all the (cached) variables you normally would have to 'calculate'
>> in the FindHDF5.cmake file.
>> So to be short: the FindHDF5.cmake file should never be required to
>> look for hdf5-config.cmake - CMake should be left to be the one to do
>> that. The HDF5 installer should be the one that installs the
>> hdf5-config.cmake into for example <prefix>/share/HDF5/cmake or some
>> similar path (look for documentation of find_package for possible
>> locations where CMake will look)
>>
>>
>
> From previous instructions by the Kitware developers, I was under the
> impression that I needed to do something like
>
> find_package( HDF5 QUIET NO_MODULE )
>
> from the FindHDF5.cmake module. It looks like FindVTK does this. Either
> way, the HDF5 CMake build does not set the standard *_INCLUDE_DIRS and
> *_LIBRARIES variables in the config file, so I have to do something. Can
> a Kitware person shed some light on this?
>
> Thanks,
> Will
>
>
>> But again: I haven't read the actual file you created :P Maybe I'm
>> overlooking some details of this particular package.
>>
>> Greetsz,
>> Jakob
>>
>> Will Dicharry wrote:
>>
>>> Hi All,
>>>
>>> I neglected the FindHDF5 module for a while because I was shifted to
>>> another project that was kind of far from CMake work, but there were
>>> a few requests for fixes features to the module. I think I have a
>>> file that has the important ones. It's attached to this message.
>>> Brad, I know I had CVS access, but I don't think I have Git access.
>>> If you'd like me to push my commits, I can but I think I'd need you
>>> to reauthorize me to do so.
>>>
>>> The changes to this module are:
>>> 1. Tim Gallagher's (cc'd) patch to handle the HDF5 Fortran library.
>>> 2. hdf5_hl is now an optional component that can be requested like
>>> the language bindings.
>>> 3. If I can find hdf5-config.cmake from the native HDF5 cmake build,
>>> I use it.
>>>
>>> I'd like it if the people I cc'd (who appear to be interested in at
>>> least one of these features) could try it and see if it works for
>>> them. I'd also like to know if I did #3 correctly, since there don't
>>> really appear to be any modules in the CMake repository that wrap
>>> around config files that don't set the variables defined in the Find
>>> module.
>>>
>>> Thanks,
>>> Will
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.cmake.org/mailman/listinfo/cmake
>>>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5852 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110606/0c223a89/attachment-0001.bin>
More information about the CMake
mailing list