[MOAB-dev] HDF5 CMake Troubles
Kuberry, Paul Allen
pakuber at sandia.gov
Fri Nov 10 15:34:43 CST 2017
Hello,
I ran into three issues while building MOAB with CMake and my own hdf5:
1.)
Although I had a version of hdf5 library on my PC (apt-get install ...), I was trying to get MOAB to build using CMake with the hdf5 from the one that I had built. It continued to pick up the system version, despite all of my efforts to get it not to.
I was getting messages like:
CMake Warning at test/CMakeLists.txt:129 (add_executable):
Cannot generate a safe runtime search path for target mbcn_test because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libhdf5.so.7] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/ascldap/users/pakuber/hdf5/lib
Some of these libraries may not be found correctly.
and this was resulting in bad builds (the system version wasn't parallel).
I fixed defaulting to the system version of hdf5 by amending the line in FindHDF5_MOAB.cmake to:find_package(HDF5 COMPONENTS C HL NO_DEFAULT_PATH)
2.) After fixing the libraries, with #1 and ensuring that I get the libraries that I'm trying to use, I found that FindHDF5_MOAB.cmake was not assigning the CMake variable HDF5_INCLUDES, which caused CMake errors.
Rebuilding hdf5 with CMake, I observed that despite finding my hdf5-config.cmake, I needed to add the line:
SET( HDF5_INCLUDES "${HDF5_INCLUDE_DIR}" )
to FindHDF5_MOAB.cmake
as can be seen in the attached diff.patch file.
3.) In config/MOABConfig.cmake.in,
in line 28 and 78 @HDF5_DIR@ is used, but in config/MOABConfig.cmake.cmake,
line 28 is replaced by @HDF5_ROOT@ while line 78 remains @HDF5_DIR@, causing build errors.
This is also address in the attached patch file.
Take care,
---------------------------------------------
Paul Kuberry
Sandia National Laboratories
P.O. Box 5800, Mailstop 1320
Albuquerque, NM 87123-1320
(505) 844-3668
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20171110/00710ff8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.patch
Type: text/x-patch
Size: 1265 bytes
Desc: diff.patch
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20171110/00710ff8/attachment-0001.bin>
More information about the moab-dev
mailing list