hdf5-rust icon indicating copy to clipboard operation
hdf5-rust copied to clipboard

Unable to compile hdf5-sys on mac OS

Open robinpaul85 opened this issue 1 year ago • 2 comments

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

robinpaul85 avatar Aug 23 '24 21:08 robinpaul85

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

mulimoen avatar Aug 24 '24 06:08 mulimoen

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 [email protected]

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

tvhong avatar Oct 24 '24 07:10 tvhong