-
-
Notifications
You must be signed in to change notification settings - Fork 553
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 arm64 macOS #3465
Build wheels for arm64 macOS #3465
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3465 +/- ##
========================================
Coverage 99.58% 99.58%
========================================
Files 256 256
Lines 20119 20119
========================================
Hits 20036 20036
Misses 83 83 ☔ View full report in Codecov by Sentry. |
I tried this on my end and I am receiving this trace when trying to import the extension module (within
which is confusing since the Edit: pypa/cibuildwheel#1345 looks related. We would need to adjust |
aea9f4f
to
2b5afc4
Compare
The newest wheels built on my branch are here: https://github.com/agriyakhetarpal/PyBaMM/actions/runs/6667379053 I tried and tested the import of the extension module on my end, the wheel can be installed correctly and #3301 removes the file that contains the CMake args and adds them to |
The question would now be about what combination to provide for the wheels: We don't need to provide all three—just two of these three choices would be fine, because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a rather delayed on this review, but I did get an error when importing pybamm with the MacOS ARM wheel:
ModuleNotFoundError: No module named 'pybtex'
After installing that I got an error with anytree
and sympy
. So I don't think the dependencies are there.
I figure this might change after #3301 is merged.
That was a bug in I think this PR is independent of the pyproject.toml PR and can be merged before? Please let us know if there is a particular order for merging these PRs. |
Yes, this was a bug and was fixed with #3475. Could you try installing from the wheel file with the
There is no order as such but I would recommend #3301 getting merged first, since 1. the |
The install and import worked on my M2, but idaklu does not seem to be installed with the wheel. pybamm.have_idaklu()
False |
Strange, it works on my end. Could you run the internals of the |
|
I was using python 3.9 if that helps. |
For very long I tried to reproduce this: across wheels for different Python versions, checked search paths from I did trace it down to this line here: https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/solvers/c_solvers/idaklu/CasadiSolverOpenMP.cpp#L498. The symbol is mentioned as a function in the SUNDIALS documentation for IDA. Soon after I realised the cause of why it returned I'll try the reverse option now, i.e., cross-compiling for x86_64 on my arm64 machine and then testing whether that wheel works as expected on an x86_64 machine. |
If cross-compilation doesn't end up working, it might be a good idea to get Cirrus CI for the repository for native compilation. They are freely and readily available and have both macOS arm64 and Linux arm64 runners. SciPy and some other scientific Python libraries are using it: in the case of SciPy it is currently as both a shared resource for PRs' tests and for building wheels for PyPI + nightlies. But if we want to keep its usage to a minimum, our thrice-a-year release cycle we should always be much below the limit for the free plan – tagging @brosaplanella for this. It would be great if this could be added to the agenda for the next developer meeting! It's also pretty easy to write Cirrus CI pipelines for this task owing to the fact that all CI services have inherently similar YAML syntax, so I can volunteer to pick that up if we do end up adding them. |
Sure I was planning to work on PyBaMM Friday, so I will take a look and see if I can help out. Debugging linking things is always a pain. Might be easier to build/test in a docker container locally so you are sure nothing exists on your path. |
Superseded by #3789. We can explore cross-compilation later, possibly during this year's rendition of GSoC or when we have upgraded SUNDIALS and SuiteSparse to newer versions. |
Description
Related to #3462, see there for extended discussion. This PR enables
cibuildwheel
to use Xcode available on GitHub Actions runners which can cross-compile wheels for macOS with arm64 architectures.Important
These wheels should be tested on M-series macOS machines, they may be downloaded from this link:
https://github.com/agriyakhetarpal/PyBaMM/actions/runs/6667379053 (updated)
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
(or$ nox -s tests
)$ python run-tests.py --doctest
(or$ nox -s doctests
)You can run integration tests, unit tests, and doctests together at once, using
$ python run-tests.py --quick
(or$ nox -s quick
).Further checks: