32
32
33
33
34
34
build_wheels :
35
- name : Wheels on ${{ matrix.platform_id }} - ${{ matrix.os }}
35
+ name : Wheels - ${{ matrix.cibw_archs }} - ${{ matrix.os }}
36
36
runs-on : ${{ matrix.os }}
37
37
strategy :
38
38
fail-fast : false
@@ -43,17 +43,30 @@ jobs:
43
43
- os : windows-latest
44
44
python-version : " 3.8"
45
45
platform_id : win_amd64
46
+ cibw_archs : " auto"
46
47
47
48
# Linux 64 bit manylinux2014
48
49
- os : ubuntu-latest
49
50
python-version : " 3.8"
50
51
platform_id : manylinux_x86_64
51
52
manylinux_image : manylinux2014
53
+ cibw_archs : " native"
52
54
53
- # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted).
55
+ # Linux 64 bit manylinux2014 for aarch64
56
+ # Separate runner because this requires emulation (only x86 runners are available) and is very slow.
57
+ - os : ubuntu-latest
58
+ python-version : " 3.8"
59
+ platform_id : manylinux_x86_64
60
+ manylinux_image : manylinux2014
61
+ cibw_archs : " aarch64"
62
+
63
+ # Use x86 macOS runner to build both x86 and ARM.
64
+ # GitHub does not offer Apple Silicon yet (only for self-hosted).
65
+ # See https://github.com/github/roadmap/issues/528
54
66
- os : macos-latest
55
67
python-version : " 3.8"
56
68
platform_id : macosx_x86_64
69
+ cibw_archs : " x86_64 arm64"
57
70
58
71
steps :
59
72
- uses : actions/checkout@v3
@@ -64,16 +77,31 @@ jobs:
64
77
with :
65
78
python-version : ${{ matrix.python-version }}
66
79
67
- # - name: Install tools (macOS)
68
- # if: contains(matrix.os, 'macos')
69
- # # Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh
70
- # #
71
- # # GitHub actions comes with libomp already installed, but for its native arch only. Must build universal one
72
- # # manually so that both x86 and arm builds can be built.
73
- # run: |
74
- # brew install coreutils
75
- # brew install libomp
76
- # sh add_arm_to_libomp_dylib.sh
80
+ # aarch64 Linux builds are cross-compiled on x86 runners using emulation
81
+ # see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
82
+ - name : Setup QEMU (for aarch64)
83
+ if : matrix.cibw_archs == 'aarch64'
84
+ uses : docker/setup-qemu-action@v2
85
+ with :
86
+ platforms : arm64
87
+
88
+ - name : Setup env (for aarch64)
89
+ if : matrix.cibw_archs == 'aarch64'
90
+ # Ask suitesparse.sh to compile faster by optimizing fewer types. Otherwise, the build takes too long to finish
91
+ # in 6 hour limit.
92
+ run : |
93
+ echo "SUITESPARSE_FAST_BUILD=1" >> $GITHUB_ENV
94
+
95
+ - name : Install tools (macOS)
96
+ if : contains(matrix.os, 'macos')
97
+ # Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh
98
+ #
99
+ # GitHub actions comes with libomp already installed, but for its native arch only. Must build universal one
100
+ # manually so that both x86 and arm builds can be built.
101
+ run : |
102
+ brew install coreutils
103
+ brew install libomp
104
+ sh add_arm_to_libomp_dylib.sh
77
105
78
106
- name : Build Wheels
79
107
env :
83
111
# Build SuiteSparse
84
112
CIBW_BEFORE_ALL : bash suitesparse.sh ${{ github.ref }}
85
113
114
+ CIBW_ENVIRONMENT_LINUX : SUITESPARSE_FAST_BUILD=${{ env.SUITESPARSE_FAST_BUILD }}
115
+
86
116
# CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows.
87
117
CIBW_ENVIRONMENT_WINDOWS : CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS"
88
118
@@ -92,11 +122,11 @@ jobs:
92
122
# Uncomment to only build CPython wheels
93
123
# CIBW_BUILD: "cp*"
94
124
95
- # macOS: build x86_64 and arm64
96
- # CIBW_ARCHS_MACOS: "x86_64 arm64"
125
+ # Architectures to build specified in matrix
126
+ CIBW_ARCHS : ${{ matrix.cibw_archs }}
97
127
98
- # No 32-bit builds
99
- CIBW_SKIP : " *-win32 *_i686 *musl*"
128
+ # No 32-bit builds, no musllinux, no PyPy aarch64 (only due to build speed, numpy does not ship aarch64 pypy wheels)
129
+ CIBW_SKIP : " *-win32 *_i686 *musl* pp*aarch64 "
100
130
101
131
# Use delvewheel on Windows.
102
132
# This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared
0 commit comments