-
Notifications
You must be signed in to change notification settings - Fork 44
323 lines (264 loc) · 11.6 KB
/
windows-build.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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
name: win-build
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
USER_CONFIG: ${{github.workspace}}/.github/config/boost/user-config.jam
jobs:
build-boost:
runs-on: windows-2019
defaults:
run:
working-directory: ${{github.workspace}}
steps:
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Create folder structure
run: |
mkdir ${{github.workspace}}/lib
- name: Cache Boost
id: cache-boost
uses: actions/cache@v3
with:
path: |
${{github.workspace}}/lib/boost
${{github.workspace}}/.github/config/boost
key: ${{ runner.os }}-boost.1.78-2
- uses: actions/checkout@v3
- name: Set Up Python 3.6
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: '3.6'
- name: Write Python 3.6 to user-config.jam
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
$pythonString = "using python `n`t: 3.6 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;"
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}}
- name: Set Up Python 3.7
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Write Python 3.7 to user-config.jam
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
$pythonString = "using python `n`t: 3.7 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;"
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}}
- name: Set Up Python 3.8
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Write Python 3.8 to user-config.jam
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
$pythonString = "using python `n`t: 3.8 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;"
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}}
- name: Set Up Python 3.9
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Write Python 3.9 to user-config.jam
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
$pythonString = "using python `n`t: 3.9 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;"
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}}
- name: Set Up Python 3.10
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Write Python 3.10 to user-config.jam
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
$pythonString = "using python `n`t: 3.10 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;"
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}}
- uses: suisei-cn/[email protected]
if: steps.cache-boost.outputs.cache-hit != 'true'
id: downloadboost
name: Download boost
with:
url: "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
target: lib/boost_1_78_0.zip
- name: Extract boost
if: steps.cache-boost.outputs.cache-hit != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
7z x lib/boost_1_78_0.zip -olib
move lib/boost_1_78_0 lib/boost
- uses: suisei-cn/[email protected]
id: downloadzlib
name: Download zlib
with:
url: "https://github.com/madler/zlib/releases/download/v1.3/zlib13.zip"
target: lib/boost/zlib13.zip
- name: Extract zlib
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
7z x lib/boost/zlib13.zip -olib/boost
- name: Build Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
Get-Content ${{env.USER_CONFIG}}
cd lib/boost
cmd.exe /c 'bootstrap.bat'
.\b2.exe --user-config=${{env.USER_CONFIG}} -j6 -sNO_ZLIB=0 -sZLIB_INCLUDE="zlib-1.3" -sZLIB_SOURCE="zlib-1.3" address-model=64 link=static python="3.6","3.7","3.8","3.9","3.10"
build-libs:
runs-on: windows-2019
defaults:
run:
working-directory: ${{github.workspace}}
steps:
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Create folder structure
run: |
mkdir ${{github.workspace}}/lib
- name: Cache Armadillo, GDAL and LASTools
id: cache-lastools-armadillo-gdal
uses: actions/cache@v3
with:
path: |
${{github.workspace}}/lib
key: ${{ runner.os }}-gdal-lastools-armadillo-latest3
- uses: suisei-cn/[email protected]
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
id: downloadarmadillo
name: Download Armadillo
with:
url: "http://sourceforge.net/projects/arma/files/armadillo-10.6.2.tar.xz"
target: lib/armadillo.tar.xz
- name: Install Armadillo
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
cd lib
dir
7z x armadillo.tar.xz
7z x armadillo-10.6.2.tar
dir
move armadillo-10.6.2 armadillo
cd armadillo
$env:Path += ';"C:\Program Files\scilab-6.1.1\bin"'
cmake -DCMAKE_BUILD_TYPE=Release -DLAPACK_LIBRARY="C:\Program Files\scilab-6.1.1\bin\lapack.lib" -DBLAS_LIBRARY="C:\Program Files\scilab-6.1.1\bin\blasplus.lib" .
msbuild.exe armadillo.sln /p:Configuration=Release
- uses: suisei-cn/[email protected]
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
id: downloadglm
name: Download GLM
with:
url: "https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip"
target: lib/glm-0.9.9.8.zip
- name: Extract GLM
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
7z x lib/glm-0.9.9.8.zip -olib
dir lib
- uses: suisei-cn/[email protected]
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
id: downloadgdal1
name: Download GDAL (1/2)
with:
url: "https://download.gisinternals.com/sdk/downloads/release-1928-x64-gdal-3-5-3-mapserver-8-0-0-libs.zip"
target: lib/gdal.zip
- name: Extract GDAL
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
cd lib
7z x gdal.zip -ogdal
dir .
dir gdal
move gdal/include/boost gdal/include/boost-gdal
- uses: suisei-cn/[email protected]
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
id: downloadlastools
name: Download LAStools
with:
url: "https://lastools.github.io/download/LAStools.zip"
target: lib/LAStools.zip
- name: Extract LAStools
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
cd lib
7z x LAStools.zip
cd LAStools
cmake -DCMAKE_BUILD_TYPE=Release .
msbuild.exe LAStools.sln /p:Configuration=Release
build-helios:
runs-on: windows-2019
needs: [build-boost, build-libs]
defaults:
run:
working-directory: ${{github.workspace}}
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- uses: suisei-cn/[email protected]
id: downloadscilab
name: Download SciLab
with:
url: "https://oos.eu-west-2.outscale.com/scilab-releases/6.1.1/scilab-6.1.1_x64.exe"
- name: Install
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
dir
Start-Process -FilePath .\scilab-6.1.1_x64.exe -ArgumentList "/SILENT /NORESTART /DIR=`"C:\Program Files\scilab-6.1.1\`"" -Wait
dir "C:\Program Files"
dir "C:\Program Files\scilab-6.1.1"
- uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Load LasTools, Armadillo and GDAL from cache
id: cache-lastools-armadillo-gdal
uses: actions/cache@v3
with:
path: |
${{github.workspace}}/lib
key: ${{ runner.os }}-gdal-lastools-armadillo-latest3
restore-keys: |
Windows-gdal-lastools-armadillo-latest
- name: Load Boost from Cache
id: cache-boost
uses: actions/cache@v3
with:
path: |
${{github.workspace}}/lib/boost
${{github.workspace}}/.github/config/boost
key: ${{ runner.os }}-boost.1.78-2
- name: Build HELIOS++
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
dir "C:\Program Files\scilab-6.1.1\bin"
$py_no_dot="${{ matrix.python-version }}"
$py_no_dot=$py_no_dot.Replace(".", "")
((Get-Content -path src\main\helios_version.cpp -Raw) -replace '(^const char \* HELIOS_VERSION = ")(.*)(";)','$1$2 - ${{ github.head_ref }}.${{ github.sha }}$3') | Set-Content -Path src\main\helios_version.cpp
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_BINDING=1 "-DPYTHON_VERSION=${{ matrix.python-version }}" -DPYTHON_PATH=${{env.pythonLocation}} -DLAPACK_LIB="C:\Program Files\scilab-6.1.1\bin\lapack.lib;C:\Program Files\scilab-6.1.1\bin\blasplus.lib" .
msbuild.exe helios.sln /p:AdditionalDependencies='"C:\Program Files\scilab-6.1.1\bin\blasplus.lib;C:\Program Files\scilab-6.1.1\bin\lapack.lib"' /p:AdditionalLibraryDirectories='"C:\Program Files\scilab-6.1.1\bin"' /p:Configuration=Release
copy ${{github.workspace}}/Release/helios.exe ${{github.workspace}}/run/helios.exe
copy ${{github.workspace}}/Release/_pyhelios.pyd "${{github.workspace}}/run/_pyhelios.cpython-$py_no_dot.pyd"
- name: Save compiled executable
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os}}-helios-pybinds-${{ matrix.python-version }}
path: |
${{github.workspace}}/run/helios.exe
${{github.workspace}}/run/_pyhelios.cpython-*.pyd
- name: Test
if: false
run: ${{github.workspace}}/run/helios.exe --test