bittremieux / spectrum_utils

Python package for efficient mass spectrometry data processing and visualization
https://spectrum-utils.readthedocs.io/
Apache License 2.0
130 stars 21 forks source link

Alternative dependency for fastobo? #40

Closed wfondrie closed 1 year ago

wfondrie commented 1 year ago

It seems that fastobo only offers wheels for Linux systems, making it a painful to install on a Mac. One solution is to contribute a MacOS build to fastobo, but is there another dependency that could work in its stead?

For example, here's the error I get when installing with pip:

ImportError: dlopen(/Users/wfondrie/mambaforge/lib/python3.10/site-packages/fastobo.cpython-310-darwin.so, 0x0002): tried: '/Users/wfondrie/mambaforge/lib/python3.10/site-packages/fastobo.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/wfondrie/mambaforge/lib/python3.10/site-packages/fastobo.cpython-310-darwin.so' (no such file), '/Users/wfondrie/mambaforge/lib/python3.10/site-packages/fastobo.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
bittremieux commented 1 year ago

Hmm, that likely causes issues on Windows as well then I assume. Weird that the multi-OS unit tests can run correctly?

Ultimately parsing OBO files isn't that complex, but the advantage of fastobo is that it represents it as an abstract syntax tree, which allows easy iterating over terms.

Dependencies is a recurring issue, and this is especially problematic if they aren't easily pip-installable. I'll have to look into how I can solve this best, probably early January.

wfondrie commented 1 year ago

Weird that the multi-OS unit tests can run correctly?

On GitHub Actions, I think the MacOS runners are still on an x86-64 platform, which may have a compatible (older) version of fastobo available. However, newer Macs run on an Apple Silicon chipset, which is arm64 instead of x86-64, which I think causes problems in this case.

I was scanning the fastobo issues and it looks like the next release may have arm64 support, so this issue may resolve itself, at least for MacOS 😄

Also, being at least a little familiar with Rust, I was able to compile fastobo myself, so its not blocking my own usage. I figured I should file an issue in case other folks or platforms were affected.

bittremieux commented 1 year ago

fastobo now has precompiled wheels available for all operating systems. As it remains the most efficient and convenient way to parse OBO files and the installation issues seem to have been resolved, I'll close this issue.