3232
3333
3434 build_wheels :
35- name : Wheels on ${{ matrix.platform_id }} - ${{ matrix.os }}
35+ name : Wheels - ${{ matrix.cibw_archs }} - ${{ matrix.os }}
3636 runs-on : ${{ matrix.os }}
3737 strategy :
3838 fail-fast : false
@@ -43,17 +43,30 @@ jobs:
4343 - os : windows-latest
4444 python-version : " 3.8"
4545 platform_id : win_amd64
46+ cibw_archs : " auto"
4647
4748 # Linux 64 bit manylinux2014
4849 - os : ubuntu-latest
4950 python-version : " 3.8"
5051 platform_id : manylinux_x86_64
5152 manylinux_image : manylinux2014
53+ cibw_archs : " native"
5254
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
5466 - os : macos-latest
5567 python-version : " 3.8"
5668 platform_id : macosx_x86_64
69+ cibw_archs : " x86_64 arm64"
5770
5871 steps :
5972 - uses : actions/checkout@v3
@@ -64,16 +77,31 @@ jobs:
6477 with :
6578 python-version : ${{ matrix.python-version }}
6679
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
77105
78106 - name : Build Wheels
79107 env :
83111 # Build SuiteSparse
84112 CIBW_BEFORE_ALL : bash suitesparse.sh ${{ github.ref }}
85113
114+ CIBW_ENVIRONMENT_LINUX : SUITESPARSE_FAST_BUILD=${{ env.SUITESPARSE_FAST_BUILD }}
115+
86116 # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows.
87117 CIBW_ENVIRONMENT_WINDOWS : CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS"
88118
@@ -92,11 +122,11 @@ jobs:
92122 # Uncomment to only build CPython wheels
93123# CIBW_BUILD: "cp*"
94124
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 }}
97127
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 "
100130
101131 # Use delvewheel on Windows.
102132 # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared
0 commit comments