forked from OpenSourceRisk/Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (146 loc) · 5.42 KB
/
build_windows.yaml
File metadata and controls
149 lines (146 loc) · 5.42 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
name: C/C++ CI Windows
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
name: building
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- arch: AMD64
platform: x64
boost-lib: 64
python-wheel: "cp38"
python-version: "3.8"
- arch: AMD64
platform: x64
boost-lib: 64
python-wheel: "cp39"
python-version: "3.9"
- arch: AMD64
platform: x64
boost-lib: 64
python-wheel: "cp310"
python-version: "3.10"
- arch: AMD64
platform: x64
boost-lib: 64
python-wheel: "cp311"
python-version: "3.11"
- arch: AMD64
platform: x64
boost-lib: 64
python-wheel: "cp312"
python-version: "3.12"
- arch: AMD64
platform: x64
boost-lib: 64
python-wheel: "cp313"
python-version: "3.13"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
if: ${{ matrix.python-version }} != "3.13"
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install setuptools for Python 3.12
if: ${{ matrix.python-version }} == "3.12"
run: |
pip install setuptools
- name: uninstall SWIG 4.1.1
run: |
choco uninstall swig
- name: install SWIG (4.3.0)
run: |
curl -L -o swigwin-4.3.0.zip https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.3.0/swigwin-4.3.0.zip
Expand-Archive -Path swigwin-4.3.0.zip -DestinationPath $env:GITHUB_WORKSPACE
echo "$env:GITHUB_WORKSPACE\swigwin-4.3.0" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
cd swigwin-4.3.0
.\swig.exe -version
- name: check
run: |
swig -version
swig -help
- name: zlib
run: |
$Url = "https://www.zlib.net/zlib131.zip"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\zlib.zip")
Expand-Archive -Path "$env:TEMP\zlib.zip" -DestinationPath C:\local
cd C:\local\zlib-1.3.1
mkdir build
cd build
cmake ..
cmake --build . --config Release
- name: eigen
run: |
$Url = "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\eigen.zip")
Expand-Archive -Path "$env:TEMP\eigen.zip" -DestinationPath C:\local
cd C:\local\eigen-3.4.0
mkdir build
cd build
cmake ..
- name: Set up Boost
run: |
$Url = "https://archives.boost.io/release/1.80.0/binaries/boost_1_80_0-msvc-14.3-${{ matrix.boost-lib }}.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=C:\local\boost"
choco install -y ninja
- name: cmake configure and build
env:
BOOST_ROOT: C:\local\boost
shell: cmd
run: |
SET ORE_DIR=%cd%
SET ORE=%cd%
SET ZLIB_ROOT=C:\local\zlib-1.3.1
SET ZLIB_INCLUDE_DIR=C:\local\zlib-1.3.1
SET Eigen3_DIR=C:\local\eigen-3.4.0
mkdir build
cd build
cmake -DORE_BUILD_DOC=OFF -DORE_BUILD_EXAMPLES=OFF -DORE_BUILD_SWIG=false -DORE_BUILD_TESTS=OFF -DORE_BUILD_APP=OFF -DORE_PYTHON_INTEGRATION=ON -DQL_BUILD_BENCHMARK=OFF -DQL_BUILD_EXAMPLES=OFF -DQL_BUILD_TEST_SUITE=OFF -DCMAKE_BUILD_TYPE=Release -DMSVC_LINK_DYNAMIC_RUNTIME=OFF -DORE_USE_ZLIB=ON -DQL_ENABLE_SESSIONS=ON -DZLIB_LIBRARY=C:\local\zlib-1.3.1\build\Release\zlibstatic.lib -DZLIB_INCLUDE_DIR=C:\local\zlib-1.3.1 -G "Visual Studio 17 2022" -A ${{ matrix.platform }} ..
cmake --build . --config Release --verbose
- name: Wrap ORE-SWIG for Python Wheels
run: |
SET BOOST=C:\local\boost
SET Boost_ROOT=C:\local\boost
SET BOOST_INCLUDEDIR=C:\local\boost
SET BOOST_LIBRARYDIR=C:\local\boost\lib${{ matrix.boost-lib }}-msvc-14.3
SET BOOST_LIB64=C:\local\boost\lib${{ matrix.boost-lib }}-msvc-14.3
SET BOOST_LIB32=C:\local\boost\lib${{ matrix.boost-lib }}-msvc-14.3
cd ${{ github.workspace }}\ORE-SWIG
python setup.py wrap
- name: Build ORE Wheels
uses: pypa/cibuildwheel@v2.22.0
env:
BOOST: C:\local\boost
BOOST_LIB64: C:\local\boost\lib${{ matrix.boost-lib }}-msvc-14.3
BOOST_LIB32: C:\local\boost\lib${{ matrix.boost-lib }}-msvc-14.3
ORE: ${{ github.workspace }}
ORE_DIR: ${{ github.workspace }}
ORE_STATIC_RUNTIME: 1
ORE_USE_ZLIB: 1
CIBW_BUILD: ${{matrix.python-wheel}}-*
#CIBW_BUILD: cp37-win_amd64
#CIBW_BUILD: cp38-win32
#CIBW_BUILD: cp37-*
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
CIBW_BUILD_VERBOSITY: 2
with:
package-dir: ${{ github.workspace }}\ORE-SWIG
- name: Save wheels as artifacts
#if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.arch }}-${{ matrix.python-version }}
path: ./wheelhouse/*.whl