James C. Sutherland wrote:
Okay - it appears that was due to an out of date cache. It now tries to link static HDF5 libraries, but is still trying to link dynamic "z" and "m" libraries:I have a question about the static library option. I did: set( HDF5_USE_STATIC_LIBRARIES 1 )which should trigger linkage with static libraries, right? But what I see in the link line is:/usr/lib/libz.dylib /usr/lib/libm.dylib /jcs/apps/hdf5_serial/lib/libhdf5_cpp.dylib /usr/lib/libz.dylib /usr/lib/libm.dylib /jcs/apps/hdf5_serial/lib/libhdf5_cpp.dylib/usr/lib/libm.dylib /jcs/apps/hdf5_serial/lib/libhdf5_cpp.a /usr/lib/libz.dylib /usr/lib/libm.dylib /jcs/apps/hdf5_serial/lib/libhdf5_cpp.aPreviously, I was adding these via target_link_libraries( ... z ) Are these two equivalent?
Hi James,Thanks for the feedback. I'm actually surprised it found the static libraries for you at all, as it looks like you're on OSX. The USE_STATIC_LIBRARIES switch was placed in there for Unix systems and is wrapped in an if( UNIX ) flag in the module itself. Where on your system are the static libm and libz? For the static option to work, they need to be in one of the default search paths, one of the paths deduced from the HDF5 wrapper compilers, or somewhere in the path specified in the HDF5_ROOT environment variable.
My solution for this is somewhat suboptimal, but it appears to be the recommended solution for now. For more details, take a look at http://www.cmake.org/Bug/view.php?id=1643.
One other question: if one requests the "CXX" component for HDF5, the hdf5_cpp library is linked in, but the hdf5 library is also required. Adding "C" and "CXX" as components fixes this problem. Perhaps the FindHDF5.cmake file could automatically activate "C" if "CXX" is requested? That might be more robust...
You're right. That was an oversight. I checked a fix into CVS for that this morning.
Thanks again for the contribution! James
-- Will Dicharry Software Developer Stellar Science Ltd Co
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ 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