[MOAB-dev] HDF5 CMake Troubles
Vijay S. Mahadevan
vijay.m at gmail.com
Fri Nov 10 16:16:47 CST 2017
Paul, we will take a look at the patch you sent and fix the issue. We
have tested our CMake configuration with system installed HDF/NetCDF
libraries and this didn't replicate the problems you mentioned.
Nevertheless, if we can improve and make the build system more robust,
all patches welcome.
If you want to submit a PR directly to our Bitbucket website in the
future, that would also add context to such additions. I will let you
know when we have the patch merged to master.
Thanks,
Vijay
On Fri, Nov 10, 2017 at 3:34 PM, Kuberry, Paul Allen <pakuber at sandia.gov> wrote:
>
> 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
More information about the moab-dev
mailing list