-
Notifications
You must be signed in to change notification settings - Fork 48
153 lines (137 loc) · 6.17 KB
/
python-wheels-emulated.yml
File metadata and controls
153 lines (137 loc) · 6.17 KB
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
name: Python-manylinux-arch
on:
workflow_call:
inputs:
os:
description: 'Host OS'
required: false
type: string
default: '["ubuntu-latest"]'
arch:
description: 'Architecture target'
required: true
type: string
vtk_major:
description: 'VTK major version'
required: false
type: string
default: '9'
vtk_minor:
description: 'VTK minor version'
required: false
type: string
default: '3'
vtk_patch:
description: 'VTK patch version'
required: false
type: string
default: '1'
permissions: write-all
jobs:
build_wheels:
name: Build Python wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ${{ fromJSON(inputs.os) }}
env:
# Skip 32-bit windows wheels builds.
CIBW_SKIP: "*-win32* pp38-* pp39-* pp310-* pp311-*"
CIBW_ARCHS: ${{inputs.arch}}
CIBW_ENVIRONMENT_LINUX: "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/project/install/lib"
CIBW_BEFORE_ALL_LINUX: >
if pip debug --verbose | grep -q 'musllinux'; then
DISTRO=musllinux_1_2
else
DISTRO=manylinux2014
fi &&
echo "Considering vtk-${DISTRO}_`uname -m`.tar.gz..." &&
mkdir -p vtk &&
tar -xvzf vtk-${DISTRO}_`uname -m`.tar.gz -C vtk/ &&
if [ -d "vtk/lib" ]; then
VTK_DIR=vtk/lib/cmake/vtk-${{inputs.vtk_major}}.${{inputs.vtk_minor}}
else
VTK_DIR=vtk/lib64/cmake/vtk-${{inputs.vtk_major}}.${{inputs.vtk_minor}}
fi &&
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=$VTK_DIR -DMOORDYN_PACKAGE_IGNORE_VTK_DEPENDENCY=ON -DBUILD_TESTING=OFF &&
cmake --build build --config Release &&
cmake --install build --config Release &&
rm -rf docs extern source tests
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_BEFORE_ALL_WINDOWS: >
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=vtk/lib/cmake/vtk-${{inputs.vtk_major}}.${{inputs.vtk_minor}} -DMOORDYN_PACKAGE_IGNORE_VTK_DEPENDENCY=ON -DBUILD_TESTING=OFF &&
cmake --build build --config Release &&
cmake --install build --config Release &&
rm -rf docs extern source tests
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path install/bin -w {dest_dir} {wheel}"
CIBW_ENVIRONMENT_MACOS: 'MACOSX_DEPLOYMENT_TARGET="10.15"'
CIBW_BEFORE_ALL_MACOS: >
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=vtk/lib/cmake/vtk-${{inputs.vtk_major}}.${{inputs.vtk_minor}} -DMOORDYN_PACKAGE_IGNORE_VTK_DEPENDENCY=ON -DBUILD_TESTING=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_INSTALL_NAME_DIR:PATH=$(pwd)/install/lib &&
cmake --build build --config Release &&
cmake --install build --config Release &&
rm -rf docs extern source tests
steps:
- uses: actions/checkout@v6
# Used to host cibuildwheel
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Create setup.py
run: |
mv wrappers/python/wheels.github/* ./
python set_version.py
python set_eigen_data.py
rm set_version.py set_eigen_data.py
cat pyproject.toml
shell: bash
- name: download pre-built VTK static library (ManyLinux)
uses: suisei-cn/actions-download-file@v1.6.1
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{inputs.vtk_major}}.${{inputs.vtk_minor}}.${{inputs.vtk_patch}}-static/vtk-manylinux2014_${{inputs.arch}}.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'Linux'
- name: download pre-built VTK static library (MUSLLinux)
uses: suisei-cn/actions-download-file@v1.6.1
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{inputs.vtk_major}}.${{inputs.vtk_minor}}.${{inputs.vtk_patch}}-static/vtk-musllinux_1_2_${{inputs.arch}}.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'Linux'
- name: download pre-built VTK static library (Windows)
uses: suisei-cn/actions-download-file@v1.6.1
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{inputs.vtk_major}}.${{inputs.vtk_minor}}.${{inputs.vtk_patch}}-static/vtk-Windows-x86_64.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'Windows'
- name: download pre-built VTK static library (MacOS)
uses: suisei-cn/actions-download-file@v1.6.1
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{inputs.vtk_major}}.${{inputs.vtk_minor}}.${{inputs.vtk_patch}}-static/vtk-macOS-${{inputs.arch}}.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'MacOS'
- name: Create folders
run: |
mkdir -p ${{github.workspace}}/vtk
mkdir -p ${{github.workspace}}/build
mkdir -p ${{github.workspace}}/install
- name: Extract VTK tgz (Windows)
run: |
tar -xvzf vtk-Windows-x86_64.tar.gz -C vtk/
if: runner.os == 'Windows'
- name: Extract VTK tgz (MacOS)
run: |
tar -xvzf vtk-macOS-${{inputs.arch}}.tar.gz -C vtk/
if: runner.os == 'MacOS'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
if: runner.os == 'Linux'
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.1
with:
output-dir: dist
- uses: actions/upload-artifact@v6
id: build_wheels
with:
name: python-wheels-${{runner.os}}_${{inputs.arch}}
path: ./dist/*