-
Notifications
You must be signed in to change notification settings - Fork 4
250 lines (218 loc) · 11.5 KB
/
windows.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
name: Windows CI
on:
pull_request:
push:
branches:
- "master"
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: ["windows-2022"]
compiler:
- { name: "visual studio", c: cl, cxx: cl }
vs:
- { name: "Visual Studio Enterprise 2022", version: "17", msvc_toolset: "14" }
python_version: ["3.12"]
architecture: ["amd64"]
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / ${{ matrix.vs.name }} / python - ${{ matrix.python_version }}
timeout-minutes: 360
defaults:
run:
shell: bash -l {0}
working-directory: .
env:
lue_source_directory: lue_source
lue_build_directory: lue_build
lue_runtime_install_directory: lue_runtime_install
lue_development_install_directory: lue_development_install
lue_consume_source_directory: lue_consume_source
lue_consume_build_directory: lue_consume_build
hpx_version: 1.10.0
hpx_branch: v1.10.0
hpx_source_directory: hpx_source
hpx_build_directory: hpx_build
hpx_install_directory: hpx_install
mdspan_tag: 9ceface91483775a6c74d06ebf717bbb2768452f # 0.6.0
mdspan_source_directory: mdspan_source
mdspan_build_directory: mdspan_build
mdspan_install_directory: mdspan_install
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.lue_source_directory }}
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
miniforge-version: latest
conda-solver: "libmamba"
python-version: ${{ matrix.python_version }}
- name: setup platform
run: |
# Don't install C++ libraries with Conda. Use Conan for that. The Conan compiler
# settings are used when building LUE. Mixing Conda/Conan packages likely results
# in conflicts. Make an exception for numpy. Use Conda only for Python packages.
# conda-build provides the conda-develop command used below
# TODO Use the GDAL Conan package instead of the Conda package, once the GDAL
# Conan package actually works
conda config --remove channels defaults
conda install \
libboost-devel \
libboost-headers \
conan \
conda-build \
docopt \
libgdal \
hdf5 \
jinja2 \
libhwloc \
matplotlib \
mimalloc \
ninja \
numpy \
ruamel.yaml
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.architecture }}
toolset: ${{ matrix.vs.msvc_toolset }}
- name: "install hpx"
uses: ./lue_source/.github/actions/install_hpx
with:
cache_key: ${{ matrix.os }}_${{ matrix.compiler.cxx }}-${{ matrix.vs.msvc_toolset }}_python-${{ matrix.python_version }}_hpx-${{ env.hpx_version }}
c_compiler: ${{ matrix.compiler.c }}
cxx_compiler: ${{ matrix.compiler.cxx }}
build_type: Release
cmake_preset: hpx_release_windows_node_configuration
cmake_preset_file: ${{ env.lue_source_directory }}/CMakeHPXPresets.json
# Passing path for Hwloc_ROOT to prevent:
# HPXConfig.cmake:160 (set):
# Syntax error in cmake code at
# D:/a/lue/lue/hpx_install/lib/cmake/HPX/HPXConfig.cmake:160
# when parsing string
# C:\Users\runneradmin\miniconda3\envs\test/Library
# Invalid character escape '\U'.
# HPX install logic needs to be updated, similar to how Boost_ROOT is handled
cmake_flags: "-D Boost_ROOT=$CONDA_PREFIX/Library -D Hwloc_ROOT=C:/Users/runneradmin/miniconda3/envs/test/Library -D Hwloc_LIBRARY=$CONDA_PREFIX/Library/lib/hwloc.lib"
hpx_branch: ${{ env.hpx_branch }}
source_directory: ${{ env.hpx_source_directory }}
build_directory: ${{ env.hpx_build_directory }}
install_directory: ${{ env.hpx_install_directory }}
- name: "install mdspan"
uses: ./lue_source/.github/actions/install_mdspan
with:
cxx_compiler: ${{ matrix.compiler.cxx }}
build_type: Release
mdspan_tag: ${{ env.mdspan_tag }}
source_directory: ${{ env.mdspan_source_directory }}
build_directory: ${{ env.mdspan_build_directory }}
install_directory: ${{ env.mdspan_install_directory }}
- name: configure
run: |
# TODO Use the GDAL Conan package instead of the Conda package, once the GDAL
# Conan package actually works
# boost gdal hdf5 hwloc mimalloc
mkdir ${{ env.lue_build_directory }}
python ${{ env.lue_source_directory }}/environment/script/write_conan_profile.py \
${{ matrix.compiler.cxx }} \
${{ env.lue_source_directory }}/host_profile
python ${{ env.lue_source_directory }}/environment/script/write_conan_profile.py \
${{ matrix.compiler.cxx }} \
${{ env.lue_source_directory }}/build_profile
LUE_CONAN_PACKAGES="glfw imgui vulkan-headers vulkan-loader" \
conan install ${{ env.lue_source_directory }} \
--profile:host=${{ env.lue_source_directory }}/host_profile \
--profile:build=${{ env.lue_source_directory }}/build_profile \
--build=missing \
--output-folder=${{ env.lue_build_directory }}
# The element types for which relevant data structures and algorithms must be instantiated are
# passed in explicitly here. To test whether this works correct and to speed up the build on
# Windows, which is slow compared to the other platforms.
# The types used are the ones needed for compatibility with PCRaster.
CMAKE_PREFIX_PATH=${{ env.lue_build_directory }} \
cmake \
-S ${{ env.lue_source_directory }} \
-B ${{ env.lue_build_directory }} \
--preset conan-release \
-D LUE_BUILD_QUALITY_ASSURANCE=TRUE \
-D LUE_QUALITY_ASSURANCE_WITH_PYTHON_API=TRUE \
-D LUE_QUALITY_ASSURANCE_WITH_TESTS=TRUE \
-D LUE_QUALITY_ASSURANCE_TEST_NR_LOCALITIES_PER_TEST=1 \
-D LUE_QUALITY_ASSURANCE_TEST_NR_THREADS_PER_LOCALITY=2 \
-D LUE_DATA_MODEL_WITH_PYTHON_API=TRUE \
-D LUE_DATA_MODEL_WITH_UTILITIES=TRUE \
-D LUE_FRAMEWORK_WITH_IMAGE_LAND=TRUE \
-D LUE_FRAMEWORK_WITH_PYTHON_API=TRUE \
-D LUE_FRAMEWORK_SIGNED_INTEGRAL_ELEMENTS=std::int32_t \
-D LUE_FRAMEWORK_UNSIGNED_INTEGRAL_ELEMENTS=std::uint8_t \
-D LUE_FRAMEWORK_FLOATING_POINT_ELEMENTS=float \
-D LUE_FRAMEWORK_BOOLEAN_ELEMENT=std::uint8_t \
-D LUE_FRAMEWORK_COUNT_ELEMENT=std::int32_t \
-D LUE_FRAMEWORK_INDEX_ELEMENT=std::int32_t \
-D LUE_FRAMEWORK_ID_ELEMENT=std::int32_t \
-D mdspan_ROOT=${{ env.mdspan_install_directory }} \
-D HPX_ROOT=${{ env.hpx_install_directory }} \
-D Hwloc_ROOT=$CONDA_PREFIX/Library \
-D Hwloc_LIBRARY=$CONDA_PREFIX/Library/lib/hwloc.lib
- name: build
run: |
cmake --build ${{ env.lue_build_directory }} --target all
- name: install
run: |
cmake \
--install ${{ env.lue_build_directory }} \
--prefix ${{ env.lue_runtime_install_directory }} \
--component lue_runtime \
--strip
cmake \
--install ${{ env.lue_build_directory }} \
--prefix ${{ env.lue_development_install_directory }} \
--component lue_development \
--strip
- name: test
run: |
# Unit tests
ctest \
--test-dir ${{ env.lue_build_directory }} \
--output-on-failure \
--exclude-regex "(algorithm_decreasing_order_test|algorithm_image_land_integrate_test|algorithm_image_land_integrate_and_allocate_test|lue_py_image_land_python_test)"
# Tests of runtime targets
# Add location of dependencies installed with Conan to the runtime environment
# Not needed yet.
# ${{ env.lue_build_directory }}/conanrun.bat
${{ env.lue_runtime_install_directory }}/bin/lue_translate --version
${{ env.lue_runtime_install_directory }}/bin/lue_validate --version
# This doesn't work due to missing Vulkan runtime
# ${{ env.lue_runtime_install_directory }}/bin/lue_view --version
# Add our package to the set of Conda packages
conda-develop ${{ env.lue_runtime_install_directory }}/lib/python${{ matrix.python_version }}
# NOTE: On Windows, locations in PATH are not used anymore by Python to lookup
# dlls. Locations must be added using os.add_dll_directory(path)
# We have added a slight hack to LUE's __init__.py to detect HPX' dll
# directory in PATH. Otherwise HPX won't be found. See comment in that file.
# Only needed on dev machines with custom HPX build, like we have here.
export PATH="`pwd`/${{ env.hpx_install_directory }}/bin:$PATH"
${{ env.lue_runtime_install_directory }}/bin/lue_calculate.py --version
${{ env.lue_runtime_install_directory }}/bin/lue_scalability.py --version
python -c "import lue, lue.data_model, lue.framework, lue.pcraster, lue.qa.scalability; print(lue.__version__)"
- name: consume
run: |
# Test of imported CMake targets
git clone https://github.com/computationalgeography/lue_consume.git ${{ env.lue_consume_source_directory }}
cmake \
-S ${{ env.lue_consume_source_directory }} \
-B ${{ env.lue_consume_build_directory }} \
-G "Ninja" \
-D CMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \
-D CMAKE_BUILD_TYPE=Release \
-D lue_ROOT=${{ env.lue_development_install_directory }} \
-D HPX_ROOT=${{ env.hpx_install_directory }} \
-D Hwloc_ROOT=$CONDA_PREFIX/Library \
-D Hwloc_LIBRARY=$CONDA_PREFIX/Library/lib/hwloc.lib \
-D mdspan_ROOT=${{ env.mdspan_install_directory }}
cmake --build ${{ env.lue_consume_build_directory }} --target all
export PATH="${{ env.lue_development_install_directory }}/bin:${{ env.hpx_install_directory }}/bin:$PATH"
${{ env.lue_consume_build_directory }}/lue_consume_data_model
${{ env.lue_consume_build_directory }}/lue_consume_framework