Skip to content
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

Update build wheels to build both arm and x86 macos wheels #39

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,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
with:
Expand Down Expand Up @@ -38,9 +45,12 @@ jobs:
CIBW_MANYLINUX_X86_64_IMAGE: "dockcross/manylinux2014-x64"
CIBW_TEST_REQUIRES: "pytest"
CIBW_TEST_COMMAND: "pytest {project}/tests"
# Skip testing on arm64 Python 3.8 because it uses the x86_64 executable, not the arm executable
CIBW_TEST_SKIP: "cp38-macosx_*:arm64"
CIBW_ENVIRONMENT_LINUX: CMAKE_GENERATOR="Unix Makefiles"
CIBW_ENVIRONMENT_MACOS: CMAKE_GENERATOR="Unix Makefiles"
CIBW_ENVIRONMENT_MACOS: CMAKE_GENERATOR="Unix Makefiles" CMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }}
CIBW_ENVIRONMENT_WINDOWS: CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM=x64
CIBW_BUILD_VERBOSITY: 1
run: |
python -m pip install cibuildwheel build
python -m cibuildwheel --output-dir wheelhouse
Expand Down
6 changes: 5 additions & 1 deletion c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
cmake_minimum_required (VERSION 3.2)
cmake_minimum_required (VERSION 3.5)

# Project name
project (qdldl_amd)

if(APPLE)
message(STATUS "Building for Apple arches: ${CMAKE_OSX_ARCHITECTURES}")
endif()

# Needed for compilation to succeed
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def __str__(self):

cmake_args = []
# What variables from the environment do we wish to pass on to cmake as variables?
cmake_env_vars = ('CMAKE_GENERATOR', 'CMAKE_GENERATOR_PLATFORM')
cmake_env_vars = ('CMAKE_GENERATOR', 'CMAKE_GENERATOR_PLATFORM', 'CMAKE_OSX_ARCHITECTURES')
for cmake_env_var in cmake_env_vars:
cmake_var = os.environ.get(cmake_env_var)
if cmake_var:
cmake_args.extend([f'-D{cmake_env_var}={cmake_var}'])

# Add parameters to cmake_args and define_macros
cmake_args += ["-DUNITTESTS=OFF"]
cmake_args += ["-DQDLDL_UNITTESTS=OFF"]
cmake_build_flags = []
lib_subdir = []

Expand Down
Loading