Skip to content

Commit 3d6fec7

Browse files
authored
Merge pull request #154 from mulimoen/feature/hdf5-c-1-10-7
Update hdf5-src to use 1.10.7
2 parents 24beeaa + c77e5c9 commit 3d6fec7

File tree

11 files changed

+131
-19
lines changed

11 files changed

+131
-19
lines changed

.github/workflows/ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ jobs:
126126
- name: Checkout repository
127127
uses: actions/checkout@v2
128128
with: {submodules: true}
129-
- name: Change to older toolchain
130-
if: matrix.os == 'macos'
131-
run: sudo xcode-select -s "/Applications/Xcode_11.7.app"
132129
- name: Install Rust (${{matrix.rust}})
133130
uses: actions-rs/toolchain@v1
134131
with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true}

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
- Added support for attributes. The Attribute API uses the new Dataset API. Attributes
4848
only supports the same operations as `hdf5` (e.g. one can not perform partial IO,
4949
but must read the entire attribute at once).
50-
50+
- Added support in `hdf5-sys` for the new functions in `hdf5` `1.10.6` and `1.10.7`.
51+
5152
### Changed
5253

5354
- Required Rust compiler version is now `1.51`.
@@ -67,6 +68,8 @@
6768
- The `ndarray` dependency has been updated to `0.15`.
6869
- `hdf5_types::Array` trait has been removed and replaced with const generics. String types
6970
are now generic over size only: `FixedAscii<N>` and `FixedUnicode<N>`.
71+
- The version of `hdf5` built in `hdf5-src` has been updated from `1.10.6` to `1.10.7`.
72+
- The `zlib` dependency is no longer included with `default-features`.
7073

7174
## 0.7.1
7275

hdf5-src/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ deprecated = []
3232
threadsafe = []
3333

3434
[dependencies]
35-
libz-sys = { version = "1.0.25", features = ["static"], optional = true }
35+
libz-sys = { version = "1.0.25", features = ["static"], optional = true, default-features=false }
3636

3737
[build-dependencies]
3838
cmake = "0.1.44"

hdf5-src/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ fn main() {
1818
"HDF5_BUILD_JAVA",
1919
"HDF5_BUILD_FORTRAN",
2020
"HDF5_BUILD_CPP_LIB",
21+
"HDF5_BUILD_UTILS",
2122
"HDF5_ENABLE_PARALLEL",
2223
] {
2324
cfg.define(option, "OFF");

hdf5-src/ext/hdf5

Submodule hdf5 updated 1364 files

hdf5-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ readme = "README.md"
1515
[dependencies]
1616
libc = "0.2"
1717
mpi-sys = { version = "0.1", optional = true }
18-
libz-sys = { version = "1.0.25", optional = true }
18+
libz-sys = { version = "1.0.25", optional = true, default-features = false }
1919
hdf5-src = { path = "../hdf5-src", version = "0.7.1", optional = true } # !V
2020

2121
# Please see README for further explanation of these feature flags

hdf5-sys/build.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ impl Version {
3535
}
3636

3737
pub fn is_valid(self) -> bool {
38-
self.major == 1
39-
&& ((self.minor == 8 && self.micro >= 4)
40-
|| (self.minor == 10)
41-
|| (self.minor == 12 && self.micro == 0))
38+
self >= Version { major: 1, minor: 8, micro: 4 }
4239
}
4340
}
4441

@@ -612,7 +609,7 @@ impl Config {
612609
let version = self.header.version;
613610
assert!(version >= Version::new(1, 8, 4), "required HDF5 version: >=1.8.4");
614611
let mut vs: Vec<_> = (5..=21).map(|v| Version::new(1, 8, v)).collect(); // 1.8.[5-21]
615-
vs.extend((0..=5).map(|v| Version::new(1, 10, v))); // 1.10.[0-5]
612+
vs.extend((0..=7).map(|v| Version::new(1, 10, v))); // 1.10.[0-7]
616613
vs.push(Version::new(1, 12, 0)); // 1.12.0
617614
for v in vs.into_iter().filter(|&v| version >= v) {
618615
println!("cargo:rustc-cfg=hdf5_{}_{}_{}", v.major, v.minor, v.micro);

hdf5-sys/src/h5.rs

+20
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,23 @@ extern "C" {
8585
extern "C" {
8686
pub fn H5is_library_threadsafe(is_ts: *mut hbool_t) -> herr_t;
8787
}
88+
89+
#[cfg(all(hdf5_1_10_7, not(hdf5_1_12_0)))]
90+
#[repr(C)]
91+
pub struct H5_alloc_stats_t {
92+
total_alloc_bytes: c_ulonglong,
93+
curr_alloc_bytes: size_t,
94+
peak_alloc_bytes: size_t,
95+
max_block_size: size_t,
96+
total_alloc_blocks_count: size_t,
97+
curr_alloc_blocks_count: size_t,
98+
peak_alloc_blocks_count: size_t,
99+
}
100+
101+
#[cfg(all(hdf5_1_10_7, not(hdf5_1_12_0)))]
102+
extern "C" {
103+
pub fn H5get_alloc_stats(stats: *mut H5_alloc_stats_t) -> herr_t;
104+
pub fn H5get_free_list_sizes(
105+
reg_size: *mut size_t, arr_size: *mut size_t, blk_size: *mut size_t, fac_size: *mut size_t,
106+
) -> herr_t;
107+
}

hdf5-sys/src/h5fd.rs

+79
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,85 @@ extern "C" {
367367
pub fn H5FDunlock(file: *mut H5FD_t) -> herr_t;
368368
}
369369

370+
#[cfg(hdf5_1_10_6)]
371+
pub mod hdfs {
372+
use super::*;
373+
pub const H5FD__CURR_HDFS_FAPL_T_VERSION: c_uint = 1;
374+
pub const H5FD__HDFS_NODE_NAME_SPACE: c_uint = 128;
375+
pub const H5FD__HDFS_USER_NAME_SPACE: c_uint = 128;
376+
pub const H5FD__HDFS_KERB_CACHE_PATH_SPACE: c_uint = 128;
377+
378+
#[repr(C)]
379+
pub struct H5FD_hdfs_fapl_t {
380+
version: i32,
381+
namenode_name: [c_char; H5FD__HDFS_NODE_NAME_SPACE as usize + 1],
382+
namenode_port: i32,
383+
user_name: [c_char; H5FD__HDFS_USER_NAME_SPACE as usize + 1],
384+
kerberos_ticket_cache: [c_char; H5FD__HDFS_KERB_CACHE_PATH_SPACE as usize + 1],
385+
stream_buffer_size: i32,
386+
}
387+
388+
extern "C" {
389+
pub fn H5FD_hdfs_init() -> hid_t;
390+
pub fn H5Pget_fapl_hdfs(fapl_id: hid_t, fa: *mut H5FD_hdfs_fapl_t) -> herr_t;
391+
pub fn H5Pset_fapl_hdfs(fapl_id: hid_t, fa: *mut H5FD_hdfs_fapl_t) -> herr_t;
392+
}
393+
}
394+
395+
#[cfg(hdf5_1_10_6)]
396+
pub mod ros3 {
397+
use super::*;
398+
pub const H5FD_CURR_ROS3_FAPL_T_VERSION: c_uint = 1;
399+
pub const H5FD_ROS3_MAX_REGION_LEN: c_uint = 128;
400+
pub const H5FD_ROS3_MAX_SECRET_ID_LEN: c_uint = 128;
401+
pub const H5FD_ROS3_MAX_SECRET_KEY_LEN: c_uint = 128;
402+
403+
#[repr(C)]
404+
pub struct H5FD_ros3_fapl_t {
405+
version: i32,
406+
authenticate: hbool_t,
407+
aws_region: [c_char; H5FD_ROS3_MAX_REGION_LEN as usize + 1],
408+
secret_id: [c_char; H5FD_ROS3_MAX_SECRET_ID_LEN as usize + 1],
409+
secret_key: [c_char; H5FD_ROS3_MAX_SECRET_KEY_LEN as usize + 1],
410+
}
411+
412+
extern "C" {
413+
pub fn H5FD_ros3_init() -> hid_t;
414+
pub fn H5Pget_fapl_ros3(fapl_id: hid_t, fa: *mut H5FD_ros3_fapl_t) -> herr_t;
415+
pub fn H5Pset_fapl_ros3(fapl_id: hid_t, fa: *mut H5FD_ros3_fapl_t) -> herr_t;
416+
}
417+
}
418+
419+
#[cfg(all(hdf5_1_10_7, not(hdf5_1_12_0)))]
420+
pub mod splitter {
421+
use super::*;
422+
423+
pub const H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION: c_uint = 1;
424+
pub const H5FD_SPLITTER_PATH_MAX: c_uint = 4096;
425+
pub const H5FD_SPLITTER_MAGIC: c_uint = 0x2B916880;
426+
427+
#[repr(C)]
428+
pub struct H5FD_splitter_vfg_config_t {
429+
magic: i32,
430+
version: c_uint,
431+
rw_fapl_id: hid_t,
432+
wo_fapl_id: hid_t,
433+
wo_path: [c_char; H5FD_SPLITTER_PATH_MAX as usize + 1],
434+
log_file_path: [c_char; H5FD_SPLITTER_PATH_MAX as usize + 1],
435+
ignore_wo_errs: hbool_t,
436+
}
437+
438+
extern "C" {
439+
pub fn H5FD_splitter_init() -> hid_t;
440+
pub fn H5Pget_fapl_splitter(
441+
fapl_id: hid_t, config_ptr: *mut H5FD_splitter_vfg_config_t,
442+
) -> herr_t;
443+
pub fn H5Pset_fapl_splitter(
444+
fapl_id: hid_t, config_ptr: *mut H5FD_splitter_vfg_config_t,
445+
) -> herr_t;
446+
}
447+
}
448+
370449
#[cfg(hdf5_1_10_2)]
371450
extern "C" {
372451
pub fn H5FDdriver_query(driver_id: hid_t, flags: *mut c_ulong) -> herr_t;

hdf5-sys/src/h5p.rs

+11
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,17 @@ extern "C" {
764764
pub fn H5Pset_dset_no_attrs_hint(dcpl_id: hid_t, minimize: hbool_t) -> herr_t;
765765
}
766766

767+
#[cfg(all(hdf5_1_10_7, not(hdf5_1_12_0)))]
768+
extern "C" {
769+
pub fn H5Pget_file_locking(
770+
fapl_id: hid_t, use_file_locking: *mut hbool_t, ignore_when_disable: *mut hbool_t,
771+
) -> herr_t;
772+
pub fn H5Pset_file_locking(
773+
fapl_id: hid_t, use_file_locking: hbool_t, ignore_when_disable: hbool_t,
774+
) -> herr_t;
775+
776+
}
777+
767778
#[cfg(hdf5_1_12_0)]
768779
extern "C" {
769780
pub fn H5Pget_vol_id(plist_id: hid_t, vol_id: *mut hid_t) -> herr_t;

hdf5-sys/src/h5s.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,14 @@ extern "C" {
112112
) -> htri_t;
113113
}
114114

115-
#[cfg(hdf5_1_12_0)]
115+
#[cfg(any(hdf5_1_12_0, hdf5_1_10_7))]
116116
extern "C" {
117117
pub fn H5Scombine_hyperslab(
118118
space_id: hid_t, op: H5S_seloper_t, start: *const hsize_t, stride: *const hsize_t,
119119
count: *const hsize_t, block: *const hsize_t,
120120
) -> hid_t;
121121
pub fn H5Scombine_select(space1_id: hid_t, op: H5S_seloper_t, space2_id: hid_t) -> hid_t;
122122
pub fn H5Smodify_select(space1_id: hid_t, op: H5S_seloper_t, space2_id: hid_t) -> herr_t;
123-
pub fn H5Ssel_iter_close(sel_iter_id: hid_t) -> herr_t;
124-
pub fn H5Ssel_iter_create(space_id: hid_t, elmt_size: size_t, flags: c_uint) -> hid_t;
125-
pub fn H5Ssel_iter_get_seq_list(
126-
sel_iter_id: hid_t, maxseq: size_t, maxbytes: size_t, nseq: *mut size_t,
127-
nbytes: *mut size_t, off: *mut hsize_t, len: *mut size_t,
128-
) -> herr_t;
129123
pub fn H5Sselect_adjust(space_id: hid_t, offset: *const hssize_t) -> herr_t;
130124
pub fn H5Sselect_copy(dst_id: hid_t, src_id: hid_t) -> herr_t;
131125
pub fn H5Sselect_intersect_block(
@@ -136,3 +130,13 @@ extern "C" {
136130
) -> hid_t;
137131
pub fn H5Sselect_shape_same(space1_id: hid_t, space2_id: hid_t) -> htri_t;
138132
}
133+
134+
#[cfg(hdf5_1_12_0)]
135+
extern "C" {
136+
pub fn H5Ssel_iter_close(sel_iter_id: hid_t) -> herr_t;
137+
pub fn H5Ssel_iter_create(space_id: hid_t, elmt_size: size_t, flags: c_uint) -> hid_t;
138+
pub fn H5Ssel_iter_get_seq_list(
139+
sel_iter_id: hid_t, maxseq: size_t, maxbytes: size_t, nseq: *mut size_t,
140+
nbytes: *mut size_t, off: *mut hsize_t, len: *mut size_t,
141+
) -> herr_t;
142+
}

0 commit comments

Comments
 (0)