aldanor / hdf5-rust

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

Unable to compile hdf5-sys on mac OS #297

Open robinpaul85 opened 2 months ago

robinpaul85 commented 2 months ago

I installed HDF5 using brew install hdf5. However it seems hdf5-sys does not currently support the most recent HDF5 version supported by brew. I managed to compile it myself by commenting several panic and assert statements in build.rs (renamed as build.txt) file of hdf5-sys. But this is a very roundabout way of compiling the crate. Can you please update the crate so that its compatible with the most recent version of HDF5 supported by brew. build.txt

mulimoen commented 2 months ago

See https://github.com/aldanor/hdf5-rust/issues/295 for an active fork

tvhong commented 3 weeks ago

For me, hdf5-sys didn't build with the latest version of hdf5 from homebrew because the latest version has 4 components (1.14.4.3) and hdf5-sys expects 3.

Error:

  Invalid H5_VERSION: "1.14.4.3"
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/4f2f477fded0a47b21ed3f6aeddeafa5db8bf518/library/std/src/panicking.rs:665:5
     1: core::panicking::panic_fmt
               at /rustc/4f2f477fded0a47b21ed3f6aeddeafa5db8bf518/library/core/src/panicking.rs:74:14
     2: build_script_build::Header::parse
     3: build_script_build::LibrarySearcher::finalize
     4: build_script_build::main
     5: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Here is the related code: https://github.com/aldanor/hdf5-rust/blob/master/hdf5-sys/build.rs#L216-L221

I installed an old version of hdf5 from homebrew to get around this:

brew install hdf5@1.10

We could probably update the build.rs to parse the version string better.