-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e0a628f
ENH: build wheels with Accelerate on macOS >=14 on Cirrus CI
rgommers c20b721
BLD: remove `-fno-strict-aliasing`, `--strip-debug` from cibuildwheel…
rgommers d02c927
DEV: add `ninja` to `test_requirements.txt` and clean up related comment
rgommers d4201a1
DOC: update comment on `RUNNER_OS` and universal2 in pyproject.toml […
rgommers 48dd929
DEBUG: only build macOS arm64 for 1 Python version per macOS version …
rgommers 0d15490
BLD: use xcode:latest images on Cirrus [wheel build]
rgommers 062bc43
BLD: use python3 executable to fix build on Sonoma
rgommers 30bf4e5
DEBUG: run only on Sonoma [wheel build]
rgommers 2efbdf9
BLD: show meson-log.txt in Cirrus CI wheel builds
rgommers d0156b8
BLD: fix macosx deployment target [wheel build]
rgommers b0b76ee
MAINT: filter deprecation warnings in f2py tests [wheel build]
rgommers 8339a5d
BLD: add back SDKROOT env var [wheel build]
rgommers 03352ce
DEBUG: hunt for bundle1.o [wheel build]
rgommers 2b7c1cf
DEBUG: back to macOS Monterey [wheel build]
rgommers 3e899f6
DEBUG: restore 11.0 deployment target config [wheel build]
rgommers a526cd6
hardcode SDKROOT in gcc spec files
isuruf c8195e8
Merge pull request #59 from isuruf/sdkroot [wheel build]
rgommers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,13 @@ | ||
build_and_store_wheels: &BUILD_AND_STORE_WHEELS | ||
install_cibuildwheel_script: | ||
- python -m pip install cibuildwheel | ||
- python3 -m pip install cibuildwheel | ||
cibuildwheel_script: | ||
- cibuildwheel | ||
always: | ||
show_meson_log_script: cat build/meson-logs/meson-log.txt | ||
wheels_artifacts: | ||
path: "wheelhouse/*" | ||
|
||
###################################################################### | ||
# Build linux_aarch64 natively | ||
###################################################################### | ||
|
||
linux_aarch64_task: | ||
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' | ||
compute_engine_instance: | ||
image_project: cirrus-images | ||
image: family/docker-builder-arm64 | ||
architecture: arm64 | ||
platform: linux | ||
cpu: 1 | ||
memory: 8G | ||
matrix: | ||
# build in a matrix because building and testing all four wheels in a | ||
# single task takes longer than 60 mins (the default time limit for a | ||
# cirrus-ci task). | ||
- env: | ||
CIRRUS_CLONE_SUBMODULES: true | ||
CIBW_BUILD: cp39-* | ||
EXPECT_CPU_FEATURES: NEON NEON_FP16 NEON_VFPV4 ASIMD ASIMDHP ASIMDDP ASIMDFHM | ||
- env: | ||
CIRRUS_CLONE_SUBMODULES: true | ||
CIBW_BUILD: cp310-* | ||
- env: | ||
CIRRUS_CLONE_SUBMODULES: true | ||
CIBW_BUILD: cp311-* | ||
- env: | ||
CIRRUS_CLONE_SUBMODULES: true | ||
CIBW_PRERELEASE_PYTHONS: True | ||
CIBW_BUILD: cp312-* | ||
|
||
build_script: | | ||
apt update | ||
apt install -y python3-venv python-is-python3 gfortran libatlas-base-dev libgfortran5 eatmydata | ||
git fetch origin | ||
bash ./tools/wheels/cibw_before_build.sh ${PWD} | ||
which python | ||
echo $CIRRUS_CHANGE_MESSAGE | ||
<<: *BUILD_AND_STORE_WHEELS | ||
|
||
|
||
###################################################################### | ||
# Build macosx_arm64 natively | ||
|
@@ -55,112 +16,32 @@ linux_aarch64_task: | |
macosx_arm64_task: | ||
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' | ||
macos_instance: | ||
image: ghcr.io/cirruslabs/macos-monterey-xcode:14 | ||
matrix: | ||
- image: ghcr.io/cirruslabs/macos-monterey-xcode:14 | ||
#- image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest | ||
matrix: | ||
- env: | ||
CIRRUS_CLONE_SUBMODULES: true | ||
CIBW_BUILD: cp39-* | ||
- env: | ||
CIRRUS_CLONE_SUBMODULES: true | ||
CIBW_BUILD: cp310-* cp311-* | ||
- env: | ||
CIRRUS_CLONE_SUBMODULES: true | ||
CIBW_PRERELEASE_PYTHONS: True | ||
CIBW_BUILD: cp312-* | ||
CIBW_BUILD: cp310-* | ||
# Specifying CIBW_ENVIRONMENT_MACOS overrides pyproject.toml, so include | ||
# all the settings from there, otherwise they're lost. | ||
env: | ||
PATH: /opt/homebrew/opt/[email protected]/bin:/usr/local/lib:/usr/local/include:$PATH | ||
CIBW_ARCHS: arm64 | ||
# Specifying CIBW_ENVIRONMENT_MACOS overrides pyproject.toml, so include | ||
# all the settings from there, otherwise they're lost. | ||
# SDKROOT needs to be set for repackaged conda-forge gfortran compilers | ||
# supplied by isuruf. | ||
# Find out SDKROOT via `xcrun --sdk macosx --show-sdk-path` | ||
CIBW_ENVIRONMENT_MACOS: > | ||
RUNNER_OS=macOS | ||
SDKROOT=/Applications/Xcode-14.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk | ||
MACOSX_DEPLOYMENT_TARGET=11.0 # 14.0 | ||
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH | ||
|
||
build_script: | ||
- brew install [email protected] | ||
- ln -s python3 /opt/homebrew/opt/[email protected]/bin/python | ||
- which python | ||
- which python3 | ||
# needed for submodules | ||
- git submodule update --init | ||
# need to obtain all the tags so setup.py can determine FULLVERSION | ||
- git fetch origin | ||
- uname -m | ||
- python -c "import platform;print(platform.python_version());print(platform.system());print(platform.machine())" | ||
- python3 -c "import platform; print(platform.python_version()); print(platform.system()); print(platform.machine())" | ||
- clang --version | ||
<<: *BUILD_AND_STORE_WHEELS | ||
|
||
|
||
###################################################################### | ||
# Upload all wheels | ||
###################################################################### | ||
|
||
wheels_upload_task: | ||
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' | ||
# Artifacts don't seem to be persistent from task to task. | ||
# Rather than upload wheels at the end of each cibuildwheel run we do a | ||
# final upload here. This is because a run may be on different OS for | ||
# which bash, etc, may not be present. | ||
depends_on: | ||
- linux_aarch64 | ||
- macosx_arm64 | ||
compute_engine_instance: | ||
image_project: cirrus-images | ||
image: family/docker-builder | ||
platform: linux | ||
cpu: 1 | ||
|
||
env: | ||
NUMPY_STAGING_UPLOAD_TOKEN: ENCRYPTED[!5a69522ae0c2af9edb2bc1cdfeaca6292fb3666d9ecd82dca0615921834a6ce3b702352835d8bde4ea2a9ed5ef8424ac!] | ||
NUMPY_NIGHTLY_UPLOAD_TOKEN: ENCRYPTED[ef04347663cfcb58d121385707e55951dc8e03b009edeed988aa4a33ba8205c54ca9980ac4da88e1adfdebff8b9d7ed4] | ||
|
||
upload_script: | | ||
apt-get update | ||
apt-get install -y curl wget | ||
export IS_SCHEDULE_DISPATCH="false" | ||
export IS_PUSH="false" | ||
|
||
# cron job | ||
if [[ "$CIRRUS_CRON" == "nightly" ]]; then | ||
export IS_SCHEDULE_DISPATCH="true" | ||
fi | ||
|
||
# a manual build was started | ||
if [[ "$CIRRUS_BUILD_SOURCE" == "api" && "$CIRRUS_COMMIT_MESSAGE" == "API build for null" ]]; then | ||
export IS_SCHEDULE_DISPATCH="true" | ||
fi | ||
|
||
# only upload wheels to staging if it's a tag beginning with 'v' and you're | ||
# on a maintenance branch | ||
if [[ "$CIRRUS_TAG" == v* ]] && [[ $CIRRUS_TAG != *"dev0"* ]]; then | ||
export IS_PUSH="true" | ||
fi | ||
|
||
if [[ $IS_PUSH == "true" ]] || [[ $IS_SCHEDULE_DISPATCH == "true" ]]; then | ||
# install miniconda in the home directory. For some reason HOME isn't set by Cirrus | ||
export HOME=$PWD | ||
|
||
# install miniconda for uploading to anaconda | ||
wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p $HOME/miniconda3 | ||
$HOME/miniconda3/bin/conda init bash | ||
source $HOME/miniconda3/bin/activate | ||
conda install -y anaconda-client | ||
|
||
# The name of the zip file is derived from the `wheels_artifact` line. | ||
# If you change the artifact line to `myfile_artifact` then it would be | ||
# called myfile.zip | ||
|
||
curl https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/wheels.zip --output wheels.zip | ||
unzip wheels.zip | ||
|
||
source ./tools/wheels/upload_wheels.sh | ||
# IS_PUSH takes precedence over IS_SCHEDULE_DISPATCH | ||
set_upload_vars | ||
|
||
# Will be skipped if not a push/tag/scheduled build | ||
upload_wheels | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.