Skip to content

Commit 9ced0ca

Browse files
authored
Merge pull request #22 from openscm/local_attempt_ci
Add windows arm64 compilation
2 parents ad7e694 + f25fbdf commit 9ced0ca

File tree

2 files changed

+25
-52
lines changed

2 files changed

+25
-52
lines changed

.github/workflows/build-wheels.yaml

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Build wheels
2-
32
# TODO: move into the release-deploy workflow and only run on published releases
43
# on:
54
# release:
@@ -38,21 +37,8 @@ jobs:
3837
cibw_archs: "aarch64"
3938
- os: windows-2025
4039
cibw_archs: "AMD64"
41-
# # Not happy at the moment hence turned off
42-
# # It doesn't seem too far away, but something isn't quite right.
43-
# # Latest run by Zeb: https://github.com/openscm/example-fgen-basic/actions/runs/17173313157/job/48725872212
44-
# # Can't find numpy definitions for some reason.
45-
# # Maybe helpful issue: https://github.com/numpy/numpy/issues/25000
46-
# # numpy uses different compilers, might be something to try, see:
47-
# # - https://github.com/numpy/numpy/actions/runs/17087345049/job/48453931521
48-
# # - https://github.com/numpy/numpy/blob/37c9cb68ba7db9c48bc0e3354953c57a78d2b0e8/.github/workflows/wheels.yml#L129
49-
# # scipy doesn't bother building windows arm wheels, see:
50-
# # - https://pypi.org/project/scipy/#files
51-
# # potentially relevant scipy issues:
52-
# # - https://github.com/scipy/scipy/issues/21716
53-
# # - https://github.com/scipy/scipy/issues/14812
54-
# - os: windows-11-arm
55-
# cibw_archs: "ARM64"
40+
- os: windows-11-arm
41+
cibw_archs: "ARM64"
5642
- os: macos-13
5743
cibw_archs: "x86_64"
5844
- os: macos-14
@@ -69,32 +55,19 @@ jobs:
6955
# TODO: figure out whether we need/want to use other compilers too
7056
compiler: "gcc"
7157
version: "13"
72-
- name: Specify MSVC toolchain - windows-arm
73-
# When building on windows ARM, we need to use the MSVC toolchain
74-
# # Original from: https://github.com/matplotlib/matplotlib/blob/1ddb1eccac8cfc25dee47bc538dc5913384b253f/.github/workflows/cibuildwheel.yml#L108
75-
# # On Windows, we explicitly request MSVC compilers (as GitHub Action runners have
76-
# # MinGW on PATH that would be picked otherwise), switch to a static build for
77-
# # runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`,
78-
# # and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while
79-
# # keeping shared state with the rest of the Python process/extensions.
80-
# CIBW_CONFIG_SETTINGS_WINDOWS: >-
81-
# setup-args="--vsenv"
82-
# setup-args="-Db_vscrt=mt"
83-
# setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']"
84-
run: |
85-
echo 'CIBW_CONFIG_SETTINGS_WINDOWS=setup-args="--vsenv" setup-args="-Db_vscrt=mt"' >> $GITHUB_ENV
86-
# TODO: figure out escaping and add back in (?)
87-
# setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']"
88-
- name: Install Fortran compiler - windows-arm
89-
# When building on windows ARM, we need to use the MSVC toolchain
58+
- name: Specify LLVM - windows-arm
9059
if: ${{ matrix.os == 'windows-11-arm' }}
91-
uses: fortran-lang/setup-fortran@v1
92-
id: setup-fortran-windows-arm
93-
with:
94-
# Only intel-classic supported by f2py
95-
# (https://numpy.org/devdocs/f2py/windows/intel.html#f2py-and-windows-intel-fortran)
96-
compiler: "intel-classic"
97-
version: "2021.10"
60+
shell: pwsh
61+
run: |
62+
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -OutFile LLVM-woa64.exe
63+
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
64+
65+
$env:PATH = "C:\Program Files\LLVM\bin;" + $env:PATH
66+
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
67+
echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
68+
echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
69+
echo "FC=flang-new" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
70+
echo "AR=llvm-lib.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
9871
- name: Build wheels
9972
uses: pypa/cibuildwheel@v3.1.4 # matplotlib had v3.1.3
10073
with:

meson.build

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ if pyprojectwheelbuild_enabled
6868
'src/example_fgen_basic/runtime_helpers.py',
6969
)
7070

71-
# The ancillary library,
72-
# i.e. all the stuff for wrapping that isn't directly exposed to Python.
73-
ancillary_lib = library(
74-
'@0@-ancillary'.format(meson.project_name()),
75-
sources: srcs_ancillary_lib,
76-
version: meson.project_version(),
77-
dependencies: [],
78-
# any other dependencies which aren't in source e.g. fgen-core
79-
# e.g. dependencies: [fgen_core_dep],
80-
install: false,
81-
)
71+
# The ancillary library,
72+
# i.e. all the stuff for wrapping that isn't directly exposed to Python.
73+
ancillary_lib = library(
74+
'@0@-ancillary'.format(meson.project_name()),
75+
sources: srcs_ancillary_lib,
76+
version: meson.project_version(),
77+
dependencies: [],
78+
# any other dependencies which aren't in source e.g. fgen-core
79+
# e.g. dependencies: [fgen_core_dep],
80+
install: false,
81+
)
8282

8383
ancillary_dep = declare_dependency(link_with: ancillary_lib)
8484

0 commit comments

Comments
 (0)