Skip to content

HDF5 Build Update, 1.0 branch (2020.10.08.)

This is to not install the PkgConfig files generated for HDF5 anymore. Since the files installed currently are not relocatable. And while that doesn't cause an issue for our installed releases (interestingly enough...), it doe make a very scary error appear in the nightly/CI builds with CMake 3.18+.

-- Configuring the build of package: HDF5Utils
/build/atnight/localbuilds/nightlies/21.2/build/install/AnalysisBaseExternals/21.2.143/InstallArea/x86_64-centos7-gcc8-opt/h5cc
dir is /build/atnight/localbuilds/nightlies/21.2/build/install/AnalysisBaseExternals/21.2.143/InstallArea/x86_64-centos7-gcc8-opt
-- Unable to determine HDF5 C flags from HDF5 wrapper.
-- Unable to determine HDF5 C version_var from HDF5 wrapper.
/build/atnight/localbuilds/nightlies/21.2/build/install/AnalysisBaseExternals/21.2.143/InstallArea/x86_64-centos7-gcc8-opt/h5c++
dir is /build/atnight/localbuilds/nightlies/21.2/build/install/AnalysisBaseExternals/21.2.143/InstallArea/x86_64-centos7-gcc8-opt
Package hdf5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `hdf5.pc'
to the PKG_CONFIG_PATH environment variable
Package 'hdf5', required by 'hdf5_cpp', not found
/tmp/atnight/ccDnp5pu.o: In function `main':
cmake_hdf5_test.cxx:(.text+0x3f): undefined reference to `H5check_version'
cmake_hdf5_test.cxx:(.text+0x49): undefined reference to `H5::FileAccPropList::DEFAULT'
cmake_hdf5_test.cxx:(.text+0x4e): undefined reference to `H5::FileCreatPropList::DEFAULT'
cmake_hdf5_test.cxx:(.text+0x60): undefined reference to `H5::H5File::H5File(char const*, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
cmake_hdf5_test.cxx:(.text+0x71): undefined reference to `H5::H5File::~H5File()'
collect2: error: ld returned 1 exit status

-- HDF5 CXX compiler wrapper is unable to compile a minimal HDF5 program.
-- Found HDF5: /build/atnight/localbuilds/nightlies/21.2/build/install/AnalysisBaseExternals/21.2.143/InstallArea/x86_64-centos7-gcc8-opt/lib/libhdf5_cpp.so;/build/atnight/localbuilds/nightlies/21.2/build/install/AnalysisBaseExternals/21.2.143/InstallArea/x86_64-centos7-gcc8-opt/lib/libhdf5.so (found suitable version "1.10.5", minimum required is "1.10.1") found components: C CXX

I didn't find any really good ways to make those files relocatable. I tried to use both ${pcfiledir} and ${@CMAKE_PROJECT_NAME@_DIR} in the generated files (for the latter the actual project names would be put there of course), but those didn't make FindHDF5.cmake work any better/different than not having the files installed at all. So I just opted for that (much simpler and I believe more robust) solution.

This is to fix ATLINFR-3763.

Merge request reports