Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile in Tauri on macOS (missing HDF5) #127

Open
nakajimayoshi opened this issue Dec 22, 2023 · 2 comments
Open

Can't compile in Tauri on macOS (missing HDF5) #127

nakajimayoshi opened this issue Dec 22, 2023 · 2 comments

Comments

@nakajimayoshi
Copy link

nakajimayoshi commented Dec 22, 2023

Platform: macOS 14.2 apple silicon

I am trying to use netcdf5 in a Tauri application. I'm starting with the basic print file example but it's running into issues at the build step with the following error:

 Compiling tauri v1.5.4
error: failed to run custom build command for `hdf5-sys v0.8.1`

Caused by:
  process didn't exit successfully: `/Users/nakaj/Documents/sandbox/nc_analyzer/metro_nc/src-tauri/target/debug/build/hdf5-sys-58f0def845f04fb4/build-script-build` (exit status: 101)
  --- stdout
  Attempting to find HDF5 via Homebrew (any version)...

  --- stderr
  thread 'main' panicked at /Users/nakaj/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hdf5-sys-0.8.1/build.rs:548:13:
  Unable to locate HDF5 root directory and/or headers.

I checked home-brew cellar and verified I already have hdf5 v1.14.3 installed.

Even after commenting out all the example code, and only importing the library, the build error persists

Solution

resolved the issue by enabling the "static" feature in the Cargo.toml:

netcdf = { version = "0.8.3", features = ["static"] }

That said, it would be nice to have some detailed instructions or a link to them for those who don't want to use a binary blob.

@nakajimayoshi nakajimayoshi changed the title Can't get print example to compile on macOS (missing HDF5) Can't get print example to compile in tour on macOS (missing HDF5) Dec 22, 2023
@nakajimayoshi nakajimayoshi changed the title Can't get print example to compile in tour on macOS (missing HDF5) Can't get print example to compile in Tauri on macOS (missing HDF5) Dec 22, 2023
@nakajimayoshi nakajimayoshi changed the title Can't get print example to compile in Tauri on macOS (missing HDF5) Can't compile in Tauri on macOS (missing HDF5) Dec 22, 2023
@magnusuMET
Copy link
Member

This is blocked on aldanor/hdf5-rust#262

For reference: The static feature builds from source and is not a binary blob per se :)

@gastoneb
Copy link

gastoneb commented Jan 2, 2024

Commenting for posterity. Specifying the static feature was the happy path to a successful windows/msvc build for me, and as a rust newb this instruction was not clear to me either.

cargo add netcdf --features static will update your project's Cargo.toml file.

I did not try the conda method but ci.yml shows you which environment variables to set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants