-
Notifications
You must be signed in to change notification settings - Fork 79
238 lines (208 loc) · 11.2 KB
/
python_wheel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: Python Wheel Build
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
Linux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64:latest
steps:
- uses: actions/checkout@v4
- name: Install fftw
run: |
yum install -y fftw3-devel
- name: Install ffi
run: |
yum install -y libffi-devel
- name: Compile python bindings
run: |
tools/finufft/build-wheels-linux.sh
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: linux-wheels
path: python/finufft/wheelhouse/finufft*manylinux*.whl
MacOS:
runs-on: macos-13
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
steps:
- uses: actions/checkout@v4
- name: Install gcc and fftw
run: |
brew unlink gcc
brew install gcc@13 fftw
cp make.inc.macosx_gcc-12 make.inc
echo "FC=gfortran-13" >> make.inc
echo "CC=gcc-13" >> make.inc
echo "CXX=g++-13" >> make.inc
echo "FFLAGS += -march=x86-64" >> make.inc
echo "CFLAGS += -march=x86-64" >> make.inc
echo "CXXFLAGS += -march=x86-64" >> make.inc
# link statically to libgcc, libgfortran and libquadmath
# otherwise binaries are incompatible with older systems
echo "LIBS += -static-libgfortran -static-libgcc -static-libstdc++" >> make.inc
# hack to make libquadmath link statically
sudo rm /usr/local/opt/gcc@13/lib/gcc/13/libquadmath.*dylib
# Download and install Python instead of using the setup_python
# as the python interpreters in the Github machines
# were compiled in 10.14, the wheels built with them
# are incompatible with older MacOS versions
- if: steps.cache-python.outputs.cache-hit != 'true'
name: Download and install Python
run: |
curl \
https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg \
--output python_installer.pkg
sudo installer -pkg python_installer.pkg -target /
curl \
https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg \
--output python_installer.pkg
sudo installer -pkg python_installer.pkg -target /
curl \
https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg \
--output python_installer.pkg
sudo installer -pkg python_installer.pkg -target /
curl \
https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg \
--output python_installer.pkg
sudo installer -pkg python_installer.pkg -target /
curl \
https://www.python.org/ftp/python/3.10.11/python-3.10.11-macos11.pkg \
--output python_installer.pkg
sudo installer -pkg python_installer.pkg -target /
curl \
https://www.python.org/ftp/python/3.11.7/python-3.11.7-macos11.pkg \
--output python_installer.pkg
sudo installer -pkg python_installer.pkg -target /
curl \
https://www.python.org/ftp/python/3.12.1/python-3.12.1-macos11.pkg \
--output python_installer.pkg
sudo installer -pkg python_installer.pkg -target /
- name: Compile python bindings
run: |
make lib
export FINUFFT_DIR=`pwd`
export CC=gcc-13
export CXX=g++-13
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install -U wheel --user
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip wheel python/finufft -w wheelhouse
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install -U wheel --user
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip wheel python/finufft -w wheelhouse
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install -U wheel --user
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip wheel python/finufft -w wheelhouse
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install -U wheel --user
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip wheel python/finufft -w wheelhouse
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install -U wheel --user
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip wheel python/finufft -w wheelhouse
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install -U wheel --user
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip wheel python/finufft -w wheelhouse
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -m pip install -U wheel --user
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -m pip wheel python/finufft -w wheelhouse
PYTHON_BIN=/Library/Frameworks/Python.framework/Versions/3.12/bin/
$PYTHON_BIN/python3 -m pip install delocate==0.10.7
ls wheelhouse/finufft*.whl | xargs -n1 $PYTHON_BIN/delocate-wheel -w fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 python/finufft/test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 python/finufft/examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pytest python/finufft/test
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 python/finufft/test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 python/finufft/examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pytest python/finufft/test
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 python/finufft/test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 python/finufft/examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pytest python/finufft/test
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 python/finufft/test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 python/finufft/examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pytest python/finufft/test
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 python/finufft/test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 python/finufft/examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pytest python/finufft/test
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 python/finufft/test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 python/finufft/examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pytest python/finufft/test
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 python/finufft/test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 python/finufft/examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -m pytest python/finufft/test
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: macos-wheels
path: fixed_wheel/*.whl
Windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install GCC and make
run: C:\msys64\usr\bin\bash.exe -lc "pacman -Sy --noconfirm make mingw-w64-x86_64-toolchain mingw-w64-x86_64-fftw"
- name: Build and Test Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'
architecture: 'x64'
- run: |
.\.github\workflows\python_build_win.ps1
.\.github\workflows\python_test_win.ps1
- name: Build and Test Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- run: |
.\.github\workflows\python_build_win.ps1
.\.github\workflows\python_test_win.ps1
- name: Build and Test Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- run: |
.\.github\workflows\python_build_win.ps1
.\.github\workflows\python_test_win.ps1
- name: Build and Test Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
- run: |
.\.github\workflows\python_build_win.ps1
.\.github\workflows\python_test_win.ps1
- name: Build and Test Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
- run: |
.\.github\workflows\python_build_win.ps1
.\.github\workflows\python_test_win.ps1
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: windows-wheels
path: wheelhouse\*.whl