Skip to content

Commit 37e98bc

Browse files
authored
add scikit-build-core based build for windows (#340)
1 parent ee024ac commit 37e98bc

File tree

7 files changed

+93
-585
lines changed

7 files changed

+93
-585
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
python-version: ["3.9", "3.13"]
37-
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] # , windows-latest]
37+
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest, windows-11-arm]
3838
arch: [auto64]
39+
exclude:
40+
- runs-on: windows-11-arm
41+
python-version: "3.9"
42+
3943
steps:
4044
- uses: actions/checkout@v4
4145
with:
@@ -46,27 +50,33 @@ jobs:
4650
with:
4751
python-version: ${{ matrix.python-version }}
4852

49-
- name: Install compiler tools on windows
53+
- if: matrix.runs-on == 'windows-11-arm'
54+
name: Install rustup on Windows ARM
55+
shell: sh
56+
run: |
57+
curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
58+
./rustup-init.exe -y --default-toolchain none --no-modify-path
59+
echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
60+
- uses: actions-rust-lang/setup-rust-toolchain@v1
61+
62+
- name: Install extra deps on windows
5063
if: runner.os == 'windows'
5164
run: |
52-
Install-Module -Name 7Zip4Powershell -Force
5365
Invoke-Webrequest -Uri https://archives.boost.io/release/1.88.0/source/boost_1_88_0.zip -OutFile boost_1_88_0.zip
5466
Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1.zip -OutFile CGAL-6.0.1.zip
55-
Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile cgal_auxlibs.zip
56-
Expand-7Zip boost_1_88_0.zip .\boost_1_88_0
57-
Expand-7Zip CGAL-6.0.1.zip .\CGAL-6.0.1
58-
Expand-7Zip cgal_auxlibs.zip .\cgal_auxlibs
59-
vcpkg.exe install getopt
67+
Expand-Archive boost_1_88_0.zip .\boost_1_88_0
68+
Expand-Archive CGAL-6.0.1.zip .\CGAL-6.0.1
6069
61-
- name: Install compiler tools on macOS
70+
- name: Install extra deps on macOS
6271
if: runner.os == 'macOS'
6372
run: |
64-
brew reinstall gfortran
65-
brew install swig boost cgal gmp mpfr
73+
brew install --ignore-dependencies swig boost cgal
6674
6775
- name: Install extra deps on Linux
6876
if: runner.os == 'Linux'
69-
run: sudo apt-get update && sudo apt-get install -y libboost-dev libmpfr-dev swig libcgal-dev
77+
run: |
78+
sudo apt-get update
79+
sudo apt-get install -y libboost-dev swig libcgal-dev
7080
7181
- name: Install package (macOS)
7282
if: runner.os == 'macOS'
@@ -81,21 +91,23 @@ jobs:
8191
echo $PATH
8292
python -m pip install '.[test]' -v -C"cmake.define.FASTJET_ENABLE_CGAL"="ON"
8393
84-
- name: Install package (windows)
85-
if: runner.os == 'windows'
94+
- name: Install package (windows x64)
95+
if: matrix.runs-on == 'windows-latest'
8696
run: |
8797
$Env:Path
88-
$Env:GMP_INC_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\include"
89-
$Env:GMP_LIB_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\lib"
90-
$Env:MPFR_INC_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\include"
91-
$Env:MPFR_LIB_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\lib"
92-
$Env:CMAKE_PREFIX_PATH = "C:\vcpkg\packages\getopt-win32_x64-windows\share\unofficial-getopt-win32;$Env:CMAKE_PREFIX_PATH"
93-
python -m pip install '.[test]' -v -C"cmake.define.GMP_DLL_TO_COPY"="C:\\a\\fastjet\\fastjet\\cgal_auxlibs\\auxiliary\\gmp\\bin\\gmp-10.dll" -C"cmake.define.Boost_INCLUDE_DIR"="${PWD}\boost_1_88_0\boost_1_88_0" -C"cmake.define.CGAL_DIR"="${PWD}\CGAL-6.0.1\CGAL-6.0.1" -C"cmake.define.FASTJET_ENABLE_DEBUG"="OFF" -C"cmake.define.SISCONE_ENABLE_DEBUG"="OFF" -C"cmake.define.FASTJET_ENABLE_CGAL"="ON"
98+
python -m pip install '.[test]' -v -C"cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0" -C"cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1" -C"cmake.define.FASTJET_ENABLE_CGAL"="ON"
99+
100+
- name: Install package (windows arm64)
101+
if: matrix.runs-on == 'windows-11-arm'
102+
run: |
103+
$Env:Path
104+
python -m pip install . -v -C"cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0" -C"cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1" -C"cmake.define.FASTJET_ENABLE_CGAL"="ON"
94105
95106
- name: List installed Python packages
96107
run: python -m pip list
97108

98109
- name: Test package
110+
if: matrix.runs-on != 'windows-11-arm'
99111
run: python -m pytest -vv -rs -Wd
100112

101113
test_wheels:
@@ -104,7 +116,7 @@ jobs:
104116
strategy:
105117
fail-fast: false
106118
matrix:
107-
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13] # , windows-latest]
119+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest, windows-11-arm]
108120
python: [313]
109121
arch: [auto64]
110122

@@ -114,68 +126,33 @@ jobs:
114126
submodules: recursive
115127
fetch-depth: 0
116128

117-
- name: Install compiler tools on macOS
129+
- name: Install extra deps on macOS
118130
if: runner.os == 'macOS'
119131
run: |
120132
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV"
121-
brew uninstall --force --ignore-dependencies gcc@12 gcc@13 gnupg gnutls isl libmpc nettle gcc mpfr gmp
122-
brew install --ignore-dependencies m4 make automake autoconf libtool swig boost cgal
133+
brew install --ignore-dependencies swig boost cgal
123134
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"
124135
125-
- name: Install compiler tools on windows
136+
- if: matrix.os == 'windows-11-arm'
137+
name: Install rustup on Windows ARM
138+
shell: sh
139+
run: |
140+
curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
141+
./rustup-init.exe -y --default-toolchain none --no-modify-path
142+
echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
143+
- uses: actions-rust-lang/setup-rust-toolchain@v1
144+
145+
- name: Install extra deps on windows
126146
if: runner.os == 'windows'
127147
run: |
128-
Install-Module -Name 7Zip4Powershell -Force
129148
Invoke-Webrequest -Uri https://archives.boost.io/release/1.88.0/source/boost_1_88_0.zip -OutFile boost_1_88_0.zip
130149
Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1.zip -OutFile CGAL-6.0.1.zip
131-
Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile cgal_auxlibs.zip
132-
Expand-7Zip boost_1_88_0.zip .\boost_1_88_0
133-
Expand-7Zip CGAL-6.0.1.zip .\CGAL-6.0.1
134-
Expand-7Zip cgal_auxlibs.zip .\cgal_auxlibs
135-
vcpkg.exe install getopt
150+
Expand-Archive -Path boost_1_88_0.zip -DestinationPath .\boost_1_88_0
151+
Expand-Archive -Path CGAL-6.0.1.zip -DestinationPath .\CGAL-6.0.1
136152
137153
- name: Install extra deps on Linux
138154
if: runner.os == 'Linux'
139-
run: sudo apt-get update && sudo apt-get install -y libboost-dev libmpfr-dev swig libcgal-dev
140-
141-
- name: Clone gmp
142-
if: runner.os == 'macOS'
143-
uses: actions/checkout@v4
144-
with:
145-
repository: gmp-mirror/gmp-6.3
146-
path: gmp-6.3
147-
148-
- name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET=11.0
149-
if: runner.os == 'macOS'
150-
working-directory: gmp-6.3
151-
run: |
152-
brew install texinfo
153-
autoreconf -i -f
154-
./configure --help
155-
./configure \
156-
--prefix=$(brew --prefix) \
157-
--enable-cxx
158-
touch ./doc/version.texi
159-
make --jobs
160-
make install
161-
162-
- name: Get mpfr release
163-
if: runner.os == 'macOS'
164-
run: |
165-
curl -Lk https://www.mpfr.org/mpfr-current/mpfr-4.2.2.tar.gz -o mpfr-4.2.2.tar.gz
166-
tar -xzf mpfr-4.2.2.tar.gz
167-
168-
- name: Build mpfr from source for MACOSX_DEPLOYMENT_TARGET=11.0
169-
if: runner.os == 'macOS'
170-
working-directory: mpfr-4.2.2
171-
run: |
172-
autoreconf -i -f
173-
./configure --help
174-
./configure \
175-
--prefix=$(brew --prefix) \
176-
--with-gmp=$(brew --prefix)
177-
make --jobs
178-
make install
155+
run: sudo apt-get update && sudo apt-get install -y libboost-dev swig libcgal-dev
179156

180157
- uses: pypa/[email protected]
181158
env:
@@ -185,15 +162,9 @@ jobs:
185162
CIBW_CONFIG_SETTINGS: >
186163
"cmake.define.FASTJET_ENABLE_CGAL"="ON"
187164
CIBW_CONFIG_SETTINGS_WINDOWS: >
188-
"cmake.define.GMP_DLL_TO_COPY"="C:\\\\a\\\\fastjet\\\\fastjet\\\\cgal_auxlibs\\\\auxiliary\\\\gmp\\\\bin\\\\gmp-10.dll"
189-
"cmake.define.Boost_INCLUDE_DIR"="C:\a\fastjet\fastjet\boost_1_88_0\boost_1_88_0"
190-
"cmake.define.CGAL_DIR"="C:\a\fastjet\fastjet\CGAL-6.0.1\CGAL-6.0.1"
191-
"cmake.define.unofficial-getopt-win32_DIR"="C:\vcpkg\packages\getopt-win32_x64-windows\share\unofficial-getopt-win32"
192-
CIBW_ENVIRONMENT_WINDOWS: >
193-
GMP_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include'
194-
GMP_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib'
195-
MPFR_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include'
196-
MPFR_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib'
165+
"cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0"
166+
"cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1"
167+
"cmake.define.FASTJET_ENABLE_CGAL"="ON"
197168
198169
- name: Upload wheels
199170
uses: actions/upload-artifact@v4

.github/workflows/wheels.yml

Lines changed: 24 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -34,74 +34,43 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
python: [39, 310, 311, 312, 313]
37-
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13] # , windows-latest]
37+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest, windows-11-arm]
3838
arch: [auto64]
39+
exclude:
40+
- os: windows-11-arm
41+
python: 39
42+
- os: windows-11-arm
43+
python: 310
3944

4045
steps:
4146
- uses: actions/checkout@v4
4247
with:
4348
submodules: recursive
4449
fetch-depth: 0
4550

46-
- name: Install compiler tools on macOS
51+
- name: Install extra deps on macOS
4752
if: runner.os == 'macOS'
4853
run: |
4954
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV"
50-
brew uninstall --force --ignore-dependencies gcc@12 gcc@13 gnupg gnutls isl libmpc nettle gcc mpfr gmp
51-
brew install --ignore-dependencies m4 make automake autoconf libtool swig boost cgal
55+
brew install --ignore-dependencies swig boost cgal
5256
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"
5357
54-
- name: Install compiler tools on windows
58+
- if: matrix.os == 'windows-11-arm'
59+
name: Install rustup on Windows ARM
60+
shell: sh
61+
run: |
62+
curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
63+
./rustup-init.exe -y --default-toolchain none --no-modify-path
64+
echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
65+
- uses: actions-rust-lang/setup-rust-toolchain@v1
66+
67+
- name: Install extra deps on windows
5568
if: runner.os == 'windows'
5669
run: |
57-
Install-Module -Name 7Zip4Powershell -Force
5870
Invoke-Webrequest -Uri https://archives.boost.io/release/1.88.0/source/boost_1_88_0.zip -OutFile boost_1_88_0.zip
5971
Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1.zip -OutFile CGAL-6.0.1.zip
60-
Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile cgal_auxlibs.zip
61-
Expand-7Zip boost_1_88_0.zip .\boost_1_88_0
62-
Expand-7Zip CGAL-6.0.1.zip .\CGAL-6.0.1
63-
Expand-7Zip cgal_auxlibs.zip .\cgal_auxlibs
64-
vcpkg.exe install getopt
65-
66-
- name: Clone gmp
67-
if: runner.os == 'macOS'
68-
uses: actions/checkout@v4
69-
with:
70-
repository: gmp-mirror/gmp-6.3
71-
path: gmp-6.3
72-
73-
- name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET
74-
if: runner.os == 'macOS'
75-
working-directory: gmp-6.3
76-
run: |
77-
export PATH="/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
78-
brew install texinfo
79-
autoreconf -i -f
80-
./configure --help
81-
./configure \
82-
--prefix=$(brew --prefix) \
83-
--enable-cxx
84-
touch ./doc/version.texi
85-
make --jobs
86-
make install
87-
88-
- name: Get mpfr release
89-
if: runner.os == 'macOS'
90-
run: |
91-
curl -Lk https://www.mpfr.org/mpfr-current/mpfr-4.2.2.tar.gz -o mpfr-4.2.2.tar.gz
92-
tar -xzf mpfr-4.2.2.tar.gz
93-
94-
- name: Build mpfr from source for MACOSX_DEPLOYMENT_TARGET=11.0
95-
if: runner.os == 'macOS'
96-
working-directory: mpfr-4.2.2
97-
run: |
98-
autoreconf -i -f
99-
./configure --help
100-
./configure \
101-
--prefix=$(brew --prefix) \
102-
--with-gmp=$(brew --prefix)
103-
make --jobs
104-
make install
72+
Expand-Archive boost_1_88_0.zip .\boost_1_88_0
73+
Expand-Archive CGAL-6.0.1.zip .\CGAL-6.0.1
10574
10675
- uses: pypa/[email protected]
10776
env:
@@ -110,15 +79,9 @@ jobs:
11079
CIBW_CONFIG_SETTINGS: >
11180
"cmake.define.FASTJET_ENABLE_CGAL"="ON"
11281
CIBW_CONFIG_SETTINGS_WINDOWS: >
113-
"cmake.define.GMP_DLL_TO_COPY"="C:\\\\a\\\\fastjet\\\\fastjet\\\\cgal_auxlibs\\\\auxiliary\\\\gmp\\\\bin\\\\gmp-10.dll"
114-
"cmake.define.Boost_INCLUDE_DIR"="C:\a\fastjet\fastjet\boost_1_88_0\boost_1_88_0"
115-
"cmake.define.CGAL_DIR"="C:\a\fastjet\fastjet\CGAL-6.0.1\CGAL-6.0.1"
116-
"cmake.define.unofficial-getopt-win32_DIR"="C:\vcpkg\packages\getopt-win32_x64-windows\share\unofficial-getopt-win32"
117-
CIBW_ENVIRONMENT_WINDOWS: >
118-
GMP_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include'
119-
GMP_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib'
120-
MPFR_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include'
121-
MPFR_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib'
82+
"cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0"
83+
"cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1"
84+
"cmake.define.FASTJET_ENABLE_CGAL"="ON"
12285
12386
- name: Upload wheels
12487
uses: actions/upload-artifact@v4
@@ -138,7 +101,7 @@ jobs:
138101

139102
- name: Install extra deps on Linux
140103
if: runner.os == 'Linux'
141-
run: sudo apt-get update && sudo apt-get install -y libboost-dev swig autoconf libtool libcgal-dev
104+
run: sudo apt-get update && sudo apt-get install -y libboost-dev swig libcgal-dev
142105

143106
- name: test sdist
144107
run: python -m pip install dist/*.tar.gz

0 commit comments

Comments
 (0)