-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: add wheels built against Accelerate for arm64 macOS >=14 #25012
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
Conversation
Ugh:
I failed to get Cirrus CI installed on my own fork - guess I'll have to try harder. |
736b618
to
a5aa53c
Compare
Hmm, there are a large amount of |
Good news is that the macOS 14 + XCode 15 image is now running. Bad news is that it needs more tweaks, it dies quickly when talking to Homebrew:
|
938cb0f
to
3a74dd6
Compare
Addresses the arm64 part of numpygh-24905.
… config It's already included in the top-level `meson.build` file, which is more correct. See numpygh-25004 for where `-fno-strict-aliasing` came from. Also clean up the `-Wl,--strip-debug` flag, it's unused since the buildtype is release and there is no debug info in the binaries.
…[wheel build] [skip actions] [skip circle] [skip azp]
[skip actions] [skip azp] [skip circle]
[skip actions] [skip azp] [skip circle]
[skip actions] [skip azp] [skip circle]
57f7a49
to
2b7c1cf
Compare
[skip actions] [skip azp] [skip circle]
Something about gfortran in CI is not working:
On the 11.0 deployment target job, getting:
for f2py tests is also a sign of some env var like |
This is not the cause, since I see the same message on a run that just passed on
|
I seem to remember something about needing the sdk-path in the environment
|
Ahhh, CI debugging! I think this might be a call for some @isuruf magic. From memory when we see errors like Having said that, the wheel build seems to be working, but it's the test that is failing. I'm wondering if the |
tools/ci/cirrus_wheels.yml
Outdated
CIBW_ENVIRONMENT_MACOS: > | ||
RUNNER_OS=macOS | ||
MACOSX_DEPLOYMENT_TARGET=11.0 # 14.0 | ||
# SDKROOT needs to be set also here (see gfortran_utils.sh) | ||
SDKROOT=/Applications/Xcode-14.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk |
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.
This path might be wrong.
I suggest
SDKROOT=/Applications/Xcode-14.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk | |
SDKROOT=/Applications/Xcode-14.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk |
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.
The test run tries to compile a fortran program in a subprocess. I suspect that this env variable isn't being passed down to the compilation.
Yeah, some paths are wrong. I think @isuruf's suggestion may be right; there may be other things wrong. The problem is that the setup is so brittle that it's almost impossible to work with:
I'm going to have to start over and change less in the shell scripts. I am also going to drop gfortran completely from the Accelerate jobs (and possibly the OpenBLAS wheel build jobs too); we don't need any Fortran compiler really - the |
Things can definitely be made more robust, but to be fair it's not the easiest to work in CI directly. I wonder if it'd be easier to install something like miniconda, and use that for python, compiler (gfortran) provision. This would hopefully get rid of the SDKROOT issues. GHA is better in this regard because there are pre-written Actions that do all this setup for us. |
Yes, agreed - definitely not easy to work with this setup. I think that's the right plan (probably micromamba rather than miniconda, faster and more self-contained). Since the For OpenBLAS we should stay with our own builds I believe - but of course we're moving to the |
conda-forge toolchain also requires this variable. Let me send a PR to fix this more robustly. |
See rgommers#59 |
I'm going to investigate https://tart.run/quick-start/ as a way of running a macos container locally. |
I've had good success with using tart to run a macOS container locally, such that would be used on CirrusCI (the ghcr.io/cirruslabs/macos-sonoma-xcode:latest image). @rgommers, if you have a mac it's going to be much faster to use a local container than try and fix things in CI. Rough Steps:
This whole setup gives you a container that is identical to that used to build wheels on cirrusci, but on your local machine. |
hardcode SDKROOT in gcc spec files [skip actions] [skip circle] [skip azp]
Actually you can install the cirrus-cli, |
@@ -144,6 +147,7 @@ if [ "$(uname)" == "Darwin" ]; then | |||
pushd /opt | |||
sudo tar -xvf gfortran-darwin-${arch}-${type}.tar.gz | |||
sudo rm gfortran-darwin-${arch}-${type}.tar.gz | |||
find gfortran-darwin-${arch}-${type} -name "libgfortran.spec" -exec sed -i.bak "s@\-lm@-lm -isysroot ${SDKROOT}@g" {} + |
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.
find gfortran-darwin-${arch}-${type} -name "libgfortran.spec" -exec sed -i.bak "s@\-lm@-lm -isysroot ${SDKROOT}@g" {} + | |
find gfortran-darwin-${arch}-${type}/lib/gcc -name "libgfortran.spec" -exec sed -i.bak "s@\-lm@-lm -isysroot ${SDKROOT}@g" {} + |
Noting that #25255 is an alternate to this PR |
Also clean up
pyproject.toml
further, thecibuildwheel
configurations are pretty understandable now.The new Accelerate-based wheels weigh in at about 5.0 MB, which is impressively small compared to the OpenBLAS arm64 wheels at ~14 MB and the OpenBLAS x86-64 wheels at ~21 MB.