aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 84 forks source link

static build for Windows using GitHub Actions #215

Closed DavidBJaffe closed 2 years ago

DavidBJaffe commented 2 years ago

I am trying to build for Windows using GitHub Actions. I had a version that built using

hdf5 = { git = "https://github.com/aldanor/hdf5-rust", branch = "master", default-features=false }
hdf5-sys = { git = "https://github.com/aldanor/hdf5-rust", branch = "master", default-features=false, features = ["static","zlib"] }

however the executable that is built gives an error H5Dread(): can't read data: inflateInit() failed, perhaps the same problem as in https://github.com/aldanor/hdf5-rust/issues/206. So I tried

hdf5 = { git = "https://github.com/aldanor/hdf5-rust", branch = "master", default-features=false }
hdf5-sys = { git = "https://github.com/aldanor/hdf5-rust", branch = "master", default-features=false, features = ["static","zlib"] }
libz-sys = { version = "1", features = ["zlib-ng"], default-features = false }

However, this does not build. I get the error message

error: could not find native static library `z`, perhaps an -L flag is missing?
error: could not compile `hdf5-sys` due to previous error

In the yaml file for GitHub Actions, I have just cargo build --release, but am guessing I need something else. Any ideas?

mulimoen commented 2 years ago

This is the same problem as in https://github.com/aldanor/hdf5-rust/pull/211. A workaround is setting this feature yourself (add libz-sys as a dependency) while waiting for a merge and release of a new version

DavidBJaffe commented 2 years ago

Solved following #211, thank you very much!!