From 0042b100f6321c06e81b8bd0f5e1df12d1209a3d Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 13 Nov 2024 11:27:14 -0600 Subject: [PATCH] changed when to use h5pcc for compiling hdf5-iotest --- tests/external/hdf5_iotest/config.sh.in | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/external/hdf5_iotest/config.sh.in b/tests/external/hdf5_iotest/config.sh.in index de97243..4041a37 100644 --- a/tests/external/hdf5_iotest/config.sh.in +++ b/tests/external/hdf5_iotest/config.sh.in @@ -1,7 +1,6 @@ #!/bin/bash export HDF5_ROOT=@HDF5_ROOT_PATH@ -export LD_LIBRARY_PATH="${HDF5_ROOT}/lib:${LD_LIBRARY_PATH}" cd hdf5-iotest ./autogen.sh @@ -10,7 +9,22 @@ cd .. rm -rf build mkdir build cd build +# The h5(p)cc wrapper correctly parses the hdf5-iotest compile command +# only in HDF5 versions >= 2.0.0 +if grep -q "#define H5_VERS_MAJOR 1" ${HDF5_ROOT}/include/H5public.h; then + CC_DEF=mpicc + LIB_APPEND="" + if [ -d ${HDF5_ROOT}/lib64 ]; then + LIB_APPEND="64" + fi + export LD_LIBRARY_PATH="${HDF5_ROOT}/lib${LIB_APPEND}:$LD_LIBRARY_PATH" + export LDFLAGS="-L${HDF5_ROOT}/lib${LIB_APPEND}" + export CPPFLAGS="-I${HDF5_ROOT}/include" + export LIBS="-lhdf5" +else + CC_DEF=${HDF5_ROOT}/bin/h5pcc +fi ../hdf5-iotest/configure --silent \ - CC=${HDF5_ROOT}/bin/h5pcc \ + CC=${CC_DEF} \ CFLAGS="@CFLAGS@"