Skip to content

Commit 892e2d2

Browse files
authored
Split macos architectures (#87)
1 parent 79522ce commit 892e2d2

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.github/workflows/wheels.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,19 @@ jobs:
6060
manylinux_image: manylinux2014
6161
cibw_archs: "aarch64"
6262

63-
# Use x86 macOS runner to build both x86 and ARM.
63+
# macOS x86
64+
- os: macos-latest
65+
python-version: "3.8"
66+
platform_id: macosx_x86_64
67+
cibw_archs: "x86_64"
68+
69+
# Use x86 macOS runner to build ARM.
6470
# GitHub does not offer Apple Silicon yet (only for self-hosted).
6571
# See https://github.com/github/roadmap/issues/528
6672
- os: macos-latest
6773
python-version: "3.8"
6874
platform_id: macosx_x86_64
69-
cibw_archs: "x86_64 arm64"
75+
cibw_archs: "arm64"
7076

7177
steps:
7278
- uses: actions/checkout@v3
@@ -117,7 +123,8 @@ jobs:
117123
CIBW_ENVIRONMENT_WINDOWS: CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS"
118124

119125
# macOS libomp requires special configs. BREW_LIBOMP=1 asks suitesparse.sh to include them.
120-
CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1"
126+
# SUITESPARSE_MACOS_ARCH asks to build a particular architecture. Either x86 or arm64.
127+
CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" SUITESPARSE_MACOS_ARCH=${{ matrix.cibw_archs }}
121128

122129
# Uncomment to only build CPython wheels
123130
# CIBW_BUILD: "cp*"
@@ -143,8 +150,8 @@ jobs:
143150
# run tests
144151
CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas"
145152

146-
# GitHub Actions macOS Intel runner cannot run ARM tests.
147-
CIBW_TEST_SKIP: "*-macosx_arm64"
153+
# GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning.
154+
# CIBW_TEST_SKIP: "*-macosx_arm64"
148155

149156
run: |
150157
python -m pip install cibuildwheel

suitesparse.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ if [ -n "${BREW_LIBOMP}" ]; then
2525
cmake_params+=(-DOpenMP_libomp_LIBRARY="omp")
2626
export LDFLAGS="-L$(brew --prefix libomp)/lib"
2727

28-
# build both x86 and ARM
29-
export CFLAGS="-arch x86_64 -arch arm64"
28+
if [ -n "${SUITESPARSE_MACOS_ARCH}" ]; then
29+
export CFLAGS="-arch ${SUITESPARSE_MACOS_ARCH}"
30+
else
31+
# build both x86 and ARM
32+
export CFLAGS="-arch x86_64 -arch arm64"
33+
fi
3034
fi
3135

3236
if [ -n "${CMAKE_GNUtoMS}" ]; then

0 commit comments

Comments
 (0)