Skip to content

Commit

Permalink
Build both arm64 and x86_64 wheels for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
imciner2 committed May 17, 2024
1 parent f4250af commit 2027e5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/build_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2022]
# Include macos-13 to get Intel x86_64 macs and maos-latest to get the Aaarch64 macs
os: [ubuntu-latest, macos-latest, macos-13, windows-2022]

# Build on the native architectures (macos-latest is arm64. macos-13 is x86_64)
include:
- os: macos-latest
osx_arch: 'arm64'
- os: macos-13
osx_arch: 'x86_64'

steps:
- uses: actions/checkout@master
Expand All @@ -29,6 +37,7 @@ jobs:
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
CIBW_TEST_REQUIRES: setuptools pytest torch numdifftools
CIBW_TEST_COMMAND: "python -m pytest -s {project}/src/osqp/tests -k \"not codegen\""
CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }}

- name: Build source
if: runner.os == 'Linux'
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ sdist.include = ["src/osqp/_version.py"]
[tool.scikit-build.cmake.define]
OSQP_ALGEBRA_BACKEND = "builtin"
OSQP_EXT_MODULE_NAME = "ext_builtin"
CMAKE_OSX_ARCHITECTURES = {env="CMAKE_OSX_ARCHITECTURES"}

[tool.pytest.ini_options]
testpaths = ["src/osqp/tests"]
Expand Down

0 comments on commit 2027e5f

Please sign in to comment.