[cmake-developers] CMake 2.8.11-rc3 ready for testing!

Biddiscombe, John A. biddisco at cscs.ch
Mon Apr 22 10:50:15 EDT 2013


One important extra point.

The MPI library was NOT built with cmake, but the HDF5 and the user's project would be. Not sure if that makes a difference

JB

From: Biddiscombe, John A.
Sent: 22 April 2013 16:46
To: 'Stephen Kelly'; cmake-developers at cmake.org
Subject: RE: [cmake-developers] CMake 2.8.11-rc3 ready for testing!


Sorry, I assumed too much familiarity with hdf5/mpi



Hdf5 has CMakelists.txt files and declares a number of targets. When built with parallel IO, hdf5 used find_package(MPI) to get the required libs and includes for the library to compile and link nicely with mpi. No problem



When you do a make install on hdf5, it creates a set of very nice cmake files

"C:\Program Files\hdf5-1.8.11\cmake\hdf5\hdf5-targets.cmake"

"C:\Program Files\hdf5-1.8.11\cmake\hdf5\hdf5-targets-debug.cmake"

"C:\Program Files\hdf5-1.8.11\cmake\hdf5\hdf5-targets-release.cmake"

"C:\Program Files\hdf5-1.8.11\cmake\hdf5\hdf5-config.cmake"

"C:\Program Files\hdf5-1.8.11\cmake\hdf5\hdf5-config-version.cmake"

Which declare imported targets for debug and release and do everything right.



Except that if the user picks up HDF5 using the syntax

find_package(HDF5 NO_MODULE)

i.e. NOT using the findhdf5 (because we want to pick up the cmake config)



then the user's project has a 'hidden' dependency on mpi includes and libs and unless they add a find_package(mpi) to their project - and add the necessary include dirs. And links - theit build will fail



What I'd like to di, is in the target import declared by hdf5, add in this transitive link dependency to m pi.



In the past I was advised not to do this, but my hope is that this can be expressed nicely with the new syntax



Yes?



JB





-----Original Message-----
From: cmake-developers-bounces at cmake.org<mailto:cmake-developers-bounces at cmake.org> [mailto:cmake-developers-bounces at cmake.org] On Behalf Of Stephen Kelly
Sent: 22 April 2013 16:35
To: cmake-developers at cmake.org<mailto:cmake-developers at cmake.org>
Subject: Re: [cmake-developers] CMake 2.8.11-rc3 ready for testing!





Biddiscombe, John A. wrote:



> May I ask one question related to the "Target Usage Requirements" ...

>

> For HDF5 (for example), the user might enable Parallel IO, which

> requires MPI. When enabled, the hdf5 cmakelists use find_package to

> get MPI and all is fine.



Hi there,



I am not familiar with hdf5 or mpi.



What are you referring to when you say "the hdf5 cmakelists" ? Do you mean FindHDF5.cmake?



>

> Users of hdf5 might not know that they are using an hdf which has

> parallel IO enabled, and compilation is complicated by the unexpected

> dependency on mpi libs and includes



Can you be specific about what is more complicated? I'm not familiar with what is complicated.



> Is this new feature designed to resolve this long standing irritation

> so that when installed, the hdf5 will add the mpi dependency behind

> the scenes?



Sort of/maybe. It is designed for use with IMPORTED targets, which in general means that the upstream uses CMake and installs a Config.cmake file.

As there is a FindHDF5.cmake, I'm guessing that is not the case here.



However, it would be possible to create IMPORTED targets in the Find file.



However, there may be other ways of solving the problems you're experiencing regarding convenience, even without these features. Using these features has certain conveniences, but they don't seem to be what you're after. What you're after seems to be possible anyway. PNG_LIBRARIES contains ZLIB_LIBRARY for example, because it depends on it. Should HDF5_LIBRARIES contain MPI_LIBRARIES?



Sorry I can't give more useful information. Maybe someone else can.



Thanks,



Steve.





--



Powered by www.kitware.com<http://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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20130422/f8e3d730/attachment.html>


More information about the cmake-developers mailing list