Skip to content

Commit 12b4067

Browse files
authored
Merge pull request #227 from mulimoen/feature/hdf5_1_14
Support hdf5 1.14.0
2 parents b229be7 + b024fc8 commit 12b4067

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

.github/workflows/ci.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ jobs:
5858
include:
5959
- {version: [email protected]}
6060
- {version: [email protected]}
61-
# - {version: hdf5-mpi, mpi: true} # TODO: re-enable once 1.14 support is merged in
61+
- {version: [email protected]}
62+
- {version: hdf5-mpi, mpi: true}
6263
steps:
6364
- name: Checkout repository
6465
uses: actions/checkout@v2
@@ -98,6 +99,9 @@ jobs:
9899
- {os: macos, version: 1.12.0, channel: conda-forge, rust: stable}
99100
- {os: windows, version: 1.12.0, channel: conda-forge, rust: stable}
100101
- {os: ubuntu, version: 1.12.1, channel: conda-forge, rust: stable}
102+
- {os: macos, version: 1.14.0, channel: conda-forge, rust: stable}
103+
- {os: windows, version: 1.14.0, channel: conda-forge, rust: stable}
104+
- {os: ubuntu, version: 1.14.0, channel: conda-forge, rust: stable}
101105
defaults:
102106
run:
103107
shell: bash -l {0}
@@ -193,7 +197,7 @@ jobs:
193197
fail-fast: false
194198
matrix:
195199
rust: [stable]
196-
version: ["1.8", "1.10", "1.12", "1.13"]
200+
version: ["1.8", "1.10", "1.12", "1.14"]
197201
steps:
198202
- name: Checkout repository
199203
uses: actions/checkout@v2
@@ -217,9 +221,9 @@ jobs:
217221
DL_PATH=hdf5-1.12.0-Std-win10_64-vs16.zip
218222
echo "MSI_PATH=hdf\\HDF5-1.12.0-win64.msi" >> $GITHUB_ENV
219223
else
220-
VERSION=1.13.2
221-
DL_PATH=windows/hdf5-1.13.2-Std-win10_64-vs16.zip
222-
echo "MSI_PATH=hdf\\HDF5-1.13.2-win64.msi" >> $GITHUB_ENV
224+
VERSION=1.14.0
225+
DL_PATH=windows/hdf5-1.14.0-Std-win10_64-vs16.zip
226+
echo "MSI_PATH=hdf\\HDF5-1.14.0-win64.msi" >> $GITHUB_ENV
223227
fi
224228
BASE_URL=https://support.hdfgroup.org/ftp/HDF5/releases
225229
echo "DL_URL=$BASE_URL/hdf5-${{matrix.version}}/hdf5-$VERSION/bin/$DL_PATH" >> $GITHUB_ENV

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- Support for HDF5 version 1.13.0.
8+
- Support for HDF5 version 1.14.0.
89
- Support field renaming via `#[hdf5(rename = "new_name")]` helper attribute.
910
- Add a `ByteReader` which implements `std::io::{Read, Seek}` for 1D `u8`
1011
datasets. Usage via `Dataset::as_byte_reader()`.

hdf5-sys/build.rs

+15-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Version {
2929
}
3030

3131
pub fn parse(s: &str) -> Option<Self> {
32-
let re = Regex::new(r"^(1)\.(8|10|12|13)\.(\d\d?)(_\d+)?(-patch\d+)?$").ok()?;
32+
let re = Regex::new(r"^(1)\.(8|10|12|13|14)\.(\d\d?)(_\d+)?(-(patch)?\d+)?$").ok()?;
3333
let captures = re.captures(s)?;
3434
Some(Self {
3535
major: captures.get(1).and_then(|c| c.as_str().parse::<u8>().ok())?,
@@ -305,14 +305,15 @@ mod macos {
305305
}
306306
// We have to explicitly support homebrew since the HDF5 bottle isn't
307307
// packaged with pkg-config metadata.
308-
let (v18, v110, v112) = if let Some(version) = config.version {
308+
let (v18, v110, v112, v114) = if let Some(version) = config.version {
309309
(
310310
version.major == 1 && version.minor == 8,
311311
version.major == 1 && version.minor == 10,
312312
version.major == 1 && version.minor == 12,
313+
version.major == 1 && version.minor == 14,
313314
)
314315
} else {
315-
(false, false, false)
316+
(false, false, false, false)
316317
};
317318
println!(
318319
"Attempting to find HDF5 via Homebrew ({})...",
@@ -322,10 +323,19 @@ mod macos {
322323
"1.10.*"
323324
} else if v112 {
324325
"1.12.*"
326+
} else if v114 {
327+
"1.14.*"
325328
} else {
326329
"any version"
327330
}
328331
);
332+
if !(v18 || v110 || v112) {
333+
if let Some(out) = run_command("brew", &["--prefix", "[email protected]"]) {
334+
if is_root_dir(&out) {
335+
config.inc_dir = Some(PathBuf::from(out).join("include"));
336+
}
337+
}
338+
}
329339
if !(v18 || v110) {
330340
if let Some(out) = run_command("brew", &["--prefix", "[email protected]"]) {
331341
if is_root_dir(&out) {
@@ -611,8 +621,9 @@ impl Config {
611621
assert!(version >= Version::new(1, 8, 4), "required HDF5 version: >=1.8.4");
612622
let mut vs: Vec<_> = (5..=21).map(|v| Version::new(1, 8, v)).collect(); // 1.8.[5-21]
613623
vs.extend((0..=8).map(|v| Version::new(1, 10, v))); // 1.10.[0-8]
614-
vs.extend((0..=1).map(|v| Version::new(1, 12, v))); // 1.12.[0-1]
624+
vs.extend((0..=2).map(|v| Version::new(1, 12, v))); // 1.12.[0-2]
615625
vs.extend((0..=0).map(|v| Version::new(1, 13, v))); // 1.13.[0-0]
626+
vs.extend((0..=0).map(|v| Version::new(1, 14, v))); // 1.14.[0-0]
616627
for v in vs.into_iter().filter(|&v| version >= v) {
617628
println!("cargo:rustc-cfg=feature=\"{}.{}.{}\"", v.major, v.minor, v.micro);
618629
println!("cargo:version_{}_{}_{}=1", v.major, v.minor, v.micro);

hdf5-sys/src/h5d.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,11 @@ extern "C" {
291291
pub type H5D_chunk_iter_op_t = Option<
292292
extern "C" fn(
293293
offset: *const hsize_t,
294-
filter_mask: u32,
294+
#[cfg(feature = "1.14.0")] filter_mask: c_uint,
295+
#[cfg(not(feature = "1.14.0"))] filter_mask: u32,
295296
addr: haddr_t,
296-
nbytes: u32,
297+
#[cfg(not(feature = "1.14.0"))] nbytes: u32,
298+
#[cfg(feature = "1.14.0")] size: hsize_t,
297299
op_data: *mut c_void,
298300
) -> c_int,
299301
>;

0 commit comments

Comments
 (0)