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

Build wheels for macOS arm64 #3

Closed
Toldbo opened this issue Sep 2, 2022 · 9 comments · Fixed by #69
Closed

Build wheels for macOS arm64 #3

Toldbo opened this issue Sep 2, 2022 · 9 comments · Fixed by #69

Comments

@Toldbo
Copy link

Toldbo commented Sep 2, 2022

Hello I am trying to install radbelt into a conda environement using:
/Users/t/opt/anaconda3/envs/radbelt/bin/pip install git+https://github.com/nasa/radbelt.git

but I get the error:
ERROR: Failed building wheel for radbelt
ERROR: Could not build wheels for radbelt, which is required to install pyproject.toml-based projects

I have also tried installing using the setup.py but I get the message :
/Users/t/opt/anaconda3/envs/radbelt/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

Can anybody help?

@lpsinger
Copy link
Contributor

lpsinger commented Sep 2, 2022

Yes, we probably need to enable wheels for M1 Macs. Will do shortly.

@Toldbo
Copy link
Author

Toldbo commented Sep 3, 2022

I managed (with help from a friend) to install it in the end. I updated homebrew, used python instead of conda, downloaded compilers again.

@etmeyer
Copy link

etmeyer commented Apr 29, 2023

Yes, having a similar issue here. We're actually trying to install the dorado-scheduling package on M1 macs and the dependency on radbelt is causing problems when using python 3.10. (Earlier python 3.8, 3.9 cause even worse problems with the multiprocessing pkg). I'd prefer to do this using a conda environment if possible, as I can't guarantee that everyone's system python will have the right package versions, etc. Radbelt installs ok but running one of the dorado examples results in an error (you can ignore the dorado-->axis sub, this is a straight clone otherwise!):

Traceback (most recent call last):
File "/Users/meyer/opt/anaconda3/envs/axis-sched/bin/axis-scheduling", line 5, in
from axis.scheduling.scripts.main import main
File "/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/axis/scheduling/init.py", line 9, in
from .orbit import Orbit, Spice, TLE
File "/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/axis/scheduling/orbit/init.py", line 8, in
from .base import Orbit
File "/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/axis/scheduling/orbit/base.py", line 10, in
from ..constraints import OrbitNightConstraint
File "/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/axis/scheduling/constraints/init.py", line 18, in
from .radiation import TrappedParticleFluxConstraint
File "/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/axis/scheduling/constraints/radiation.py", line 9, in
from radbelt import get_flux
File "/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/radbelt/init.py", line 13, in
from .core import igrf as _igrf, aep8 as _aep8
ImportError: dlopen(/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/radbelt/core.cpython-310-darwin.so, 0x0002): tried: '/Applications/CPLEX_Studio2211/opl/bin/arm64_osx/core.cpython-310-darwin.so' (no such file), '/core.cpython-310-darwin.so' (no such file), '/Users/meyer/opt/anaconda3/envs/axis-sched/lib/python3.10/site-packages/radbelt/core.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))

@lpsinger
Copy link
Contributor

lpsinger commented May 1, 2023

Unfortunately, we don't have prebuilt wheels for Apple silicon machines yet. We rely on GitHub Actions runners to build them, and GitHub hasn't added these machines yet. According to github/roadmap#528, they are anticipated in 2023 Q3.

@lpsinger lpsinger changed the title Cannot install radbelt Build wheels for macOS arm64 Jul 4, 2023
@kokroo
Copy link

kokroo commented Aug 11, 2023

Unfortunately, we don't have prebuilt wheels for Apple silicon machines yet. We rely on GitHub Actions runners to build them, and GitHub hasn't added these machines yet. According to github/roadmap#528, they are anticipated in 2023 Q3.

Do we really need Apple Silicon runners for that? Cross-platform/architecture compilation exists and I would love to help with it.

I have Windows, Linux, and macOS machines (Both Intel and Apple Silicon macs). I can help you out with this, just need some pointers first :)

Cheers! @lpsinger

@lpsinger
Copy link
Contributor

@kokroo, there is an existing PR for this, #16. As you can see from the CI logs, it's failing because the version of libgfortran provided by Homebrew is neither an arm64 binary nor a universal binary.

@kokroo
Copy link

kokroo commented Aug 11, 2023

@lpsinger I just checked the whole issue. It's not a homebrew issue really, turns out there's no stable Fortran compiler that's easily usable on Apple Silicon right now.

I will just rewrite our Fortran code in another portable language and this won't be an issue. Cheers!

@lpsinger
Copy link
Contributor

@kokroo, would you please check if the Apple Silicon wheels from #69 work?

@kokroo
Copy link

kokroo commented Jan 31, 2024

@kokroo, would you please check if the Apple Silicon wheels from #69 work?

It works, tested with Python 3.11 and 3.12 on an M1 Pro with the latest macOS.

lpsinger added a commit that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants