Skip to content
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
55 changes: 14 additions & 41 deletions .github/workflows/build-wheels.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Build wheels

# TODO: move into the release-deploy workflow and only run on published releases
# on:
# release:
Expand Down Expand Up @@ -38,21 +37,8 @@ jobs:
cibw_archs: "aarch64"
- os: windows-2025
cibw_archs: "AMD64"
# # Not happy at the moment hence turned off
# # It doesn't seem too far away, but something isn't quite right.
# # Latest run by Zeb: https://github.com/openscm/example-fgen-basic/actions/runs/17173313157/job/48725872212
# # Can't find numpy definitions for some reason.
# # Maybe helpful issue: https://github.com/numpy/numpy/issues/25000
# # numpy uses different compilers, might be something to try, see:
# # - https://github.com/numpy/numpy/actions/runs/17087345049/job/48453931521
# # - https://github.com/numpy/numpy/blob/37c9cb68ba7db9c48bc0e3354953c57a78d2b0e8/.github/workflows/wheels.yml#L129
# # scipy doesn't bother building windows arm wheels, see:
# # - https://pypi.org/project/scipy/#files
# # potentially relevant scipy issues:
# # - https://github.com/scipy/scipy/issues/21716
# # - https://github.com/scipy/scipy/issues/14812
# - os: windows-11-arm
# cibw_archs: "ARM64"
- os: windows-11-arm
cibw_archs: "ARM64"
- os: macos-13
cibw_archs: "x86_64"
- os: macos-14
Expand All @@ -69,32 +55,19 @@ jobs:
# TODO: figure out whether we need/want to use other compilers too
compiler: "gcc"
version: "13"
- name: Specify MSVC toolchain - windows-arm
# When building on windows ARM, we need to use the MSVC toolchain
# # Original from: https://github.com/matplotlib/matplotlib/blob/1ddb1eccac8cfc25dee47bc538dc5913384b253f/.github/workflows/cibuildwheel.yml#L108
# # On Windows, we explicitly request MSVC compilers (as GitHub Action runners have
# # MinGW on PATH that would be picked otherwise), switch to a static build for
# # runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`,
# # and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while
# # keeping shared state with the rest of the Python process/extensions.
# CIBW_CONFIG_SETTINGS_WINDOWS: >-
# setup-args="--vsenv"
# setup-args="-Db_vscrt=mt"
# setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']"
run: |
echo 'CIBW_CONFIG_SETTINGS_WINDOWS=setup-args="--vsenv" setup-args="-Db_vscrt=mt"' >> $GITHUB_ENV
# TODO: figure out escaping and add back in (?)
# setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']"
- name: Install Fortran compiler - windows-arm
# When building on windows ARM, we need to use the MSVC toolchain
- name: Specify LLVM - windows-arm
if: ${{ matrix.os == 'windows-11-arm' }}
uses: fortran-lang/setup-fortran@v1
id: setup-fortran-windows-arm
with:
# Only intel-classic supported by f2py
# (https://numpy.org/devdocs/f2py/windows/intel.html#f2py-and-windows-intel-fortran)
compiler: "intel-classic"
version: "2021.10"
shell: pwsh
run: |
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -OutFile LLVM-woa64.exe
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait

$env:PATH = "C:\Program Files\LLVM\bin;" + $env:PATH
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "FC=flang-new" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "AR=llvm-lib.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build wheels
uses: pypa/cibuildwheel@v3.1.4 # matplotlib had v3.1.3
with:
Expand Down
22 changes: 11 additions & 11 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ if pyprojectwheelbuild_enabled
'src/example_fgen_basic/runtime_helpers.py',
)

# The ancillary library,
# i.e. all the stuff for wrapping that isn't directly exposed to Python.
ancillary_lib = library(
'@0@-ancillary'.format(meson.project_name()),
sources: srcs_ancillary_lib,
version: meson.project_version(),
dependencies: [],
# any other dependencies which aren't in source e.g. fgen-core
# e.g. dependencies: [fgen_core_dep],
install: false,
)
# The ancillary library,
# i.e. all the stuff for wrapping that isn't directly exposed to Python.
ancillary_lib = library(
'@0@-ancillary'.format(meson.project_name()),
sources: srcs_ancillary_lib,
version: meson.project_version(),
dependencies: [],
# any other dependencies which aren't in source e.g. fgen-core
# e.g. dependencies: [fgen_core_dep],
install: false,
)

ancillary_dep = declare_dependency(link_with: ancillary_lib)

Expand Down
Loading