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 install on macbook M1 - Enabled feature "threadsafe" but the HDF5 library was not built with HDF5_ENABLE_THREADSAFE #173

Closed
nleroy917 opened this issue Oct 23, 2023 · 2 comments

Comments

@nleroy917
Copy link

nleroy917 commented Oct 23, 2023

I am having some trouble installing SnapATAC2 on my MacBook. I had the exact same issue described in #140, but I was able to solve it by attempting to install from source after patching the hdf5 and hdf5-sys crates.

However, I hit another roadblock. When trying to install, I got an error indicating that usage of the features = ["threadsafe"] was causing problems:

--- stderr
  thread 'main' panicked at ~/.cargo/git/checkouts/hdf5-rust-c1072d7a2617f7d8/26046fb/hdf5-sys/build.rs:697:17:
  Enabled feature "threadsafe" but the HDF5 library was not built with HDF5_ENABLE_THREADSAFE
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
     1: core::panicking::panic_fmt
               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
     2: build_script_build::Config::check_against_features_required
     3: build_script_build::LibrarySearcher::finalize
     4: build_script_build::main
     5: core::ops::function::FnOnce::call_once

I recognize that this is a problem with my own hdf5 installation, but it seems like installing threadsafe hdf5 is not an easy thing to do very common. I had to custom edit some homebrew formulas to get even close to that. Moreover, the people over at hdf5 suggested just using the static feature over the threadsafe feature.

update: I even tried pulling one of their binaries, but that didn't work either since it seems like those weren't build with --enable-threadsafe

Any thoughts? Whats a good way to get this going locally I am eager to try it out and very excited about this project!

@kaizhang
Copy link
Owner

kaizhang commented Oct 23, 2023

I believe this problem may be caused by a locally installed HDF5 library. Either uninstalling the HDF5 library installed by homebrew or unsetting the "HDF5_DIR" environmental variable may solve this problem.

The patch is unnecessary as I've successfully installed it on my M1 macbook without patch. Just try the following:

unset HDF5_DIR
pip install snapatac2

@nleroy917
Copy link
Author

Wow, that was it... so simple. Thank you so much for the help. Hopefully, my suggestion in the other issue thread solves things for the other user.

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

No branches or pull requests

2 participants