Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport fix for Unidata/netcdf-c#2674 #175

Merged
merged 3 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci_support/linux_64_mpimpich.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_64_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_64_mpiopenmpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_mpimpich.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_mpiopenmpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_ppc64le_mpimpich.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_ppc64le_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_ppc64le_mpiopenmpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- gxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_64_mpimpich.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- clangxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_64_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- clangxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_64_mpiopenmpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- clangxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_arm64_mpimpich.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- clangxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_arm64_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- clangxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_arm64_mpiopenmpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- clangxx
cxx_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channel_sources:
channel_targets:
- conda-forge main
curl:
- '7'
- '8'
cxx_compiler:
- vs2019
hdf4:
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ if [[ ${HOST} =~ .*darwin.* ]]; then
# or to fix ld64 so that it checks for symbols being used in this section).
export LDFLAGS=$(echo "${LDFLAGS}" | sed "s/-Wl,-dead_strip_dylibs//g")
export HDF5_PLUGIN_PATH=$(echo "H5_DEFAULT_PLUGINDIR" | clang-cpp -P -include $PREFIX/include/H5pubconf.h - | tr -d '"')
export CMAKE_ARGS="${CMAKE_ARGS} -DHAVE_CLOCK_GETTIME:BOOL=OFF"
else
export HDF5_PLUGIN_PATH=$(echo "H5_DEFAULT_PLUGINDIR" | $CPP -P -include $PREFIX/include/H5pubconf.h - | tr -d '"')
fi
Expand Down
4 changes: 3 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "4.9.2" %}
{% set build = 3 %}
{% set build = 4 %}

# recipe-lint fails if mpi is undefined
{% set mpi = mpi or 'nompi' %}
Expand All @@ -20,6 +20,7 @@ source:
- patches/0009-topsrcdir.patch
- patches/prevent_MS_runtime_libs_being_installed_again.patch # [win]
- patches/do_not_use_16_processes_in_tests.patch # [ppc64le]
- patches/0001-Fix-issue-2674.patch

build:
number: {{ build }}
Expand Down Expand Up @@ -107,3 +108,4 @@ extra:
- msarahan
- xylar
- dopplershift
- zklaus
56 changes: 56 additions & 0 deletions recipe/patches/0001-Fix-issue-2674.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From b61e5cb9022b98312e6135bda859108352b531f0 Mon Sep 17 00:00:00 2001
From: uweschulzweida <[email protected]>
Date: Wed, 5 Apr 2023 18:05:53 +0200
Subject: [PATCH] Fix issue #2674

---
libhdf5/hdf5open.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/libhdf5/hdf5open.c b/libhdf5/hdf5open.c
index cb2491ff..e00f426e 100644
--- a/libhdf5/hdf5open.c
+++ b/libhdf5/hdf5open.c
@@ -1205,12 +1205,14 @@ static int get_quantize_info(NC_VAR_INFO_T *var)
{
hid_t attid;
hid_t datasetid;
+ htri_t attr_exists;

/* Try to open an attribute of the correct name for quantize
* info. */
datasetid = ((NC_HDF5_VAR_INFO_T *)var->format_var_info)->hdf_datasetid;
- attid = H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITGROOM_ATT_NAME,
- H5P_DEFAULT, H5P_DEFAULT);
+ attr_exists = H5Aexists(datasetid, NC_QUANTIZE_BITGROOM_ATT_NAME);
+ attid = attr_exists ? H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITGROOM_ATT_NAME,
+ H5P_DEFAULT, H5P_DEFAULT) : 0;

if (attid > 0)
{
@@ -1218,16 +1220,18 @@ static int get_quantize_info(NC_VAR_INFO_T *var)
}
else
{
- attid = H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_GRANULARBR_ATT_NAME,
- H5P_DEFAULT, H5P_DEFAULT);
+ attr_exists = H5Aexists(datasetid, NC_QUANTIZE_GRANULARBR_ATT_NAME);
+ attid = attr_exists ? H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_GRANULARBR_ATT_NAME,
+ H5P_DEFAULT, H5P_DEFAULT) : 0;
if (attid > 0)
{
var->quantize_mode = NC_QUANTIZE_GRANULARBR;
}
else
{
- attid = H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITROUND_ATT_NAME,
- H5P_DEFAULT, H5P_DEFAULT);
+ attr_exists = H5Aexists(datasetid, NC_QUANTIZE_BITROUND_ATT_NAME);
+ attid = attr_exists ? H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITROUND_ATT_NAME,
+ H5P_DEFAULT, H5P_DEFAULT) : 0;
if (attid > 0)
var->quantize_mode = NC_QUANTIZE_BITROUND;
}
--
2.39.1