Skip to content

HDF5: use cmake-based build and bump version to 1.10.2

Knut Zoch requested to merge kzoch/atlasexternals:hdf5 into master

Related ticket: ATLINFR-2464 (HDF5 Links Incorrectly in AnalysisBaseExternals)

This is an updated version of !315 (closed), and is basically another attempt to fix the broken linkage of the HDF5 libraries, that are built as part of AnalysisBaseExternals and AthAnalysisExternals. The problem: with the current automake-based build, local versions of HDF5 on the build machines are picked up and are cross-linked with parts of the externals-build version of HDF5. This works fine on the same machine, but breaks if machines do not have a/the same local HDF5 version installed.

With HDF5 v1.10.2, the cmake-based build finally adds rules to install h5cc, a script used to determine the correct configuration for the C bindings of HDF5. h5cc is located and executed by cmake's default FindHDF5.cmake module, and is therefore necessary for picking up HDF5 within AnalysisBase. The implementation up to now uses automake and then h5redeploy to re-locate the HDF5 installation correctly and fix the hard-coded paths in h5cc. With the cmake-based build, however, h5redeploy does not get installed, but should also not be necessary, because h5cc uses pkg-config to determine the configuration, that is (I hope), everything should be relocatable by default.

This MR switches to the cmake-based build, and updates HDF5 to v1.10.2, i.e. h5cc gets installed and the FindHDF5.cmake module should be able to pick the installation up correctly. I tested this on my local desktop and AnalysisBaseExternals + AnalysisBase compiles fine, with ttree2hdf5, one of the executables in AnalysisBase using HDF5, correctly linking against all libraries:

ldd $(which ttree2hdf5) | grep hdf5 -i
        libHDF5Utils.so => /home/kzoch/externals/build/install/AnalysisBase/21.2.39/InstallArea/x86_64-slc6-gcc62-opt/lib/libHDF5Utils.so (0x00007f4291c89000)
        libhdf5_cpp.so.101 => /home/kzoch/externals/build/install/AnalysisBaseExternals/21.2.39/InstallArea/x86_64-slc6-gcc62-opt/lib/libhdf5_cpp.so.101 (0x00007f42917a1000)
        libhdf5.so.101 => /home/kzoch/externals/build/install/AnalysisBaseExternals/21.2.39/InstallArea/x86_64-slc6-gcc62-opt/lib/libhdf5.so.101 (0x00007f429123c000)

Now the remaining question is if this build procedure also works on a machine that does have a pre-built version of HDF5 installed (because my deskop doesn't).

Edited by Knut Zoch

Merge request reports