aldanor / hdf5-rust

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

Not finding freshly installed hdf5 1.12 on Windows 10 #102

Closed thomasaarholt closed 4 years ago

thomasaarholt commented 4 years ago

Hiya,

I've just tried installing HDF5 1.12 and restarting my Windows 10 computer. I have not previously tried running hdf5-rust, so I don't know if this is something to do with the latest version, my Windows install, or hdf5-rust. My hdf5 install is located at C:\Program Files\HDF_Group\HDF5\1.12.0, (this folder contains the bin, include, etc. folders).

Running the example from the readme, I'm getting

Caused by:
  process didn't exit successfully: `C:\Users\thomasaar\Documents\GitHub\example\target\debug\build\hdf5-sys-c8a649b3d21048b6\build-script-build` (exit code: 101)
--- stdout
Searching for installed HDF5 (any version)...
Found no HDF5 installations.
thomasaarholt commented 4 years ago

Since the code tells me it might be relevant, here is a screenshot of the regedit properties of the uninstall reg for the hdf5 installation: image

magnusuMET commented 4 years ago

Hi, this crate is not yet compatible with 1.12, see #94 and #95. If you try PR #95 you could set HDF5_DIR and the crate should compile with this version. You can add this to your Cargo.toml

[patch]
[patch.crates-io]
hdf5 = { git = "https://github.com/mulimoen/hdf5-rust.git", branch="feature/hdf5-1.12.0" }

Another option is building HDF5 from source and linking statically. To do this you can add

[patch]
[patch.crates-io]
hdf5 = { git = "https://github.com/aldanor/hdf5-rust.git", features = ["hdf5-sys/static"] }
thomasaarholt commented 4 years ago

Excellent! I'm new to Rust, so this is a nice learning experience. I'll try this tomorrow!

thomasaarholt commented 4 years ago

The first suggestion worked beautifully! Just one little typo: [patch.crates.io] -> [patch.crates-io].

aldanor commented 4 years ago

Should be fixed by #95