Ticket #11388 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Find HDF5 headers in exotic locations

Reported by: Federico M Pouzols Owned by: Federico M Pouzols
Priority: minor Milestone: Release 3.4
Component: Tools Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description (last modified by Federico M Pouzols) (diff)

Note: another ticket (#11359) introudced changes related to this. CMake/CommonSetup.cmake now checks for HDF5, but it turns out that a small modification is still needed to actually find the hdf5 include directories (something that only becomes an issue when the headers are not installed in /usr/include or similar).

In our cmake files we are not explicitly looking for HDF5. That is not a big problem, as libnexus depends on it and the hdf5 headers seem to be shipped in /usr/include on all (most) ~nix systems. But it turns out that on debian it is possible to install different flavors/parallel implementations of libhdf5 simultaneously. Depending on the package that you install the headers go to different places that require a specific additional include dir:

  • libhdf5-dev -> /usr/include/hdf5/serial/
  • libhdf5-mpi-dev libhdf5-openmpi-dev -> /usr/include/hdf5/openmpi/
  • libhdf5-mpich-dev -> /usr/include/hdf5/mpich/

So to compile mantid on debian cleanly we need to add HDF5 as a dependency and use FindHDF5 in the cmake files to find the include dir that is needed for libhdf5 (FindHDF5 uses h5c++ etc. to find includes etc.).

At the moment only DataHandling/LoadSassena includes hdf5.h directly. Well, after #11359, there are a couple more source files that include hdf5 headers.

Change History

comment:1 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from new to inprogress

find hdf5 and add its include dirs, re #11388

Changeset: b89b2594a30e10955e4c45ff66bd91b8c7d8e34b

comment:2 Changed 6 years ago by Martyn Gigg

Just a note that I have had to do this as part of #11359 as I needed to use hdf5 in another package. It would be worth checking after that is merged that it compiles on Debian still.

Last edited 6 years ago by Martyn Gigg (previous) (diff)

comment:3 Changed 6 years ago by Federico M Pouzols

Thanks for the note Martyn. Cool to see things fixed. I was about to delete this branch and set this to duplicate but somehow it doesn't compile after #11359 has been merged in. On my linux HDF5_INCLUDE_DIRS is set to /include/hdf5;/include/hdf5/c++;/include/hdf5/hl! I think I figured out why, I think that where it says:

if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" OR OSX_VERSION VERSION_LESS 10.9)

It should say

if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" OR (APPLE AND OSX_VERSION VERSION_LESS 10.9))

Or otherwise it will take the cmake.config that comes with mantid. That would explain why it wasn't working before (I hadn't noticed there was a find_package inside DataHandlin/CMakeLists.txt). I'll get back to this later.

comment:4 Changed 6 years ago by Martyn Gigg

Agreed. That change would make sense.

comment:5 Changed 6 years ago by Federico Montesino Pouzols

detect apple <10.9 correctly, so FindHDF5 runs elsewhere, re #11388

Changeset: 69635b4f9e239f9176d044e24132a5a410274fe2

comment:6 Changed 6 years ago by Federico M Pouzols

  • Description modified (diff)

comment:7 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from inprogress to verify
  • Resolution set to fixed

This is being verified as pull request #429.

comment:8 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:9 Changed 6 years ago by Martyn Gigg

:+1: This is a sensible change and we might need debian in the not too distant future for the ESS so it is good to get things fixed!

comment:10 Changed 6 years ago by Martyn Gigg

  • Status changed from verifying to closed

Merge pull request #429 from mantidproject/11388_find_hdf5_headers_in_exotic_places

Find HDF5 headers in exotic locations

Full changeset: 363d25b3d1540650fc6a21b0632685c94ce8c067

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12227

Note: See TracTickets for help on using tickets.