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

Support devices with Apple M1 chip #231

Closed
swhiteCQC opened this issue Jan 18, 2021 · 3 comments · Fixed by #246
Closed

Support devices with Apple M1 chip #231

swhiteCQC opened this issue Jan 18, 2021 · 3 comments · Fixed by #246
Labels
enhancement New feature or request

Comments

@swhiteCQC
Copy link

What is the expected enhancement?

Publish a version of retworkx which supports Apple's new M1 chip so it can be installed via pip.

@mtreinish
Copy link
Member

Thanks for opening an issue on this. It might be a while before we can publish universal2 wheels (the python packaging format that supports arm on macOS) for macOS. I've been tracking pypa/cibuildwheel#473 (which is the tracker for the tool used to build the binaries that get uploaded to pypi). Once that is closed and released I'll work on adding a job that builds release binaries for arm on mac. But, this is blocked until cibuildwheel supports it.

That being said I do not have access to arm hardware on mac and without free CI resources available that are using the new CPU there won't be any testing of the binaries. Any wheels we build will likely be cross-compiled from an x86_64 mac and therefore untested until there are CI resources available.

Have you tried the source package on pypi? If you have a native version of python and the rust compiler installed I would expect pip install retworkx to download the sdist and try to compile retworkx from source which, while not ideal, should work fine. Did this result in an error?

@swhiteCQC
Copy link
Author

Thanks for the response, I appreciate we're still at fairly early days but thought it would be good to get it on your radar. I was having issues when retworkx was a transitive dependency but just got it to build from source as you suggested and it seems to be working.

@mtreinish mtreinish added enhancement New feature or request on hold labels Jan 27, 2021
mtreinish added a commit to mtreinish/retworkx that referenced this issue Feb 9, 2021
With the recent release of cibuildwheel 1.9.0 support for building arm64
binaries on macOS was added. This enables us to build release binaries
for this new platform. However, these binaries will be cross-compiled
and not tested since there are no CI resources with the platform
available. This commit adds a new release wheel job to build a aarch64
binary and publish an arm64 wheel for macOS. This will enable users who
have an arm64 mac to run retworkx without having to either build from
source or run under rosetta 2.

Fixes Qiskit#231
mtreinish added a commit to mtreinish/retworkx that referenced this issue Feb 9, 2021
With the recent release of cibuildwheel 1.9.0 support for building arm64
binaries on macOS was added. This enables us to build release binaries
for this new platform. However, these binaries will be cross-compiled
and not tested since there are no CI resources with the platform
available. This commit adds a new release wheel job to build a aarch64
binary and publish an arm64 wheel for macOS. This will enable users who
have an arm64 mac to run retworkx without having to either build from
source or run under rosetta 2.

Fixes Qiskit#231
mtreinish added a commit that referenced this issue Feb 9, 2021
* Add release job to publish macOS arm64 binaries

With the recent release of cibuildwheel 1.9.0 support for building arm64
binaries on macOS was added. This enables us to build release binaries
for this new platform. However, these binaries will be cross-compiled
and not tested since there are no CI resources with the platform
available. This commit adds a new release wheel job to build a aarch64
binary and publish an arm64 wheel for macOS. This will enable users who
have an arm64 mac to run retworkx without having to either build from
source or run under rosetta 2.

Fixes #231

* DNM: Testing the wheel builds

* Install aarch64-apple-darwin target

* Random guess at cross lib dir

* Update PYO3_CROSS_LIB path

* Revert "DNM: Testing the wheel builds"

Tested the wheel builds work and @nonhermitian confirmed the built
wheels worked on an arm64 mac locally.

This reverts commit 2a6ff1f.

* Install twine in arm64 wheel job

* Add release notes
@mtreinish
Copy link
Member

I've added the job to build an arm64 macOS wheel at release time. The next retworkx release, 0.8.0, will also publish a python 3.9 arm64 macOS wheel. I'm hoping to have the release ready in the next couple of weeks (the only blocker for it right now is #229)

@mtreinish mtreinish removed the on hold label Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants