Commit c237104
authored
feat(compat.opencl): the loader builds on Windows, and the test stops skipping there (#379)
* feat(compat.opencl): the loader builds on Windows, and the test stops skipping there
The package had linux and macosx entries and no windows one, so a Windows
consumer had no OpenCL loader to link and `tests/examples/opencl` compiled to a
printed skip. The gap was stated in the recipe and tracked nowhere.
Upstream has supported Windows all along: `loader/windows/` enumerates drivers
from `HKLM\SOFTWARE\Khronos\OpenCL\Vendors`, from the display adapters through
DXGK, and from installed app packages, and loads each with LoadLibrary. The
section here is upstream's WIN32 source list with upstream's two link
libraries, `cfgmgr32` and `runtimeobject`.
NO RUNTIME ADAPTER, AND THE ASYMMETRY IS THE POINT. `compat.opencl-runtime`
exists to undo mcpp's PRIVATE loader on Linux, where a bare-soname dlopen from
inside an mcpp binary does not search the host's library path. A Windows
artifact runs under the system loader and every registry entry names a DLL by
absolute path, so there is nothing to undo -- this platform gets a loader with
no adapter beside it.
STATIC, as on macOS. A program that wants THE system loader links the vendor's
`OpenCL.lib` against `C:\Windows\System32\OpenCL.dll`; a package shipping a
second `OpenCL.dll` would compete with that rather than converge on it. Static
also keeps `loader/windows/OpenCL.def` out of the build, which only a DLL
needs.
The member test now declares the dependency unconditionally and its skip branch
says what it actually means -- built without the loader -- rather than naming a
platform that no longer lacks one. Linux is unchanged and still reports
`platform: NVIDIA CUDA / device: NVIDIA GeForce RTX 4080` on a machine with a
driver.
The Windows half is verified by this repository's `workspace (windows default)`
job, which is the only Windows available to the change.
* fix(compat.opencl): name the Windows import libraries MSVC would have auto-linked
The first Windows section carried upstream's two link libraries and nothing
else, because that is all upstream's CMakeLists names. MSVC never has to name
the rest: its SDK headers pull the default import libraries in through
`#pragma comment(lib, ...)`. mcpp links with lld and does not inherit that.
The build compiled cleanly and failed at link with nine undefined symbols --
eight registry and process-token calls and `StringFromGUID2` -- so advapi32
and ole32 are named here.
Measured on this repository's Windows job, which is the only Windows this
change has. The compile was never the criterion.1 parent a589ca1 commit c237104
3 files changed
Lines changed: 88 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | 80 | | |
| |||
153 | 169 | | |
154 | 170 | | |
155 | 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 | + | |
156 | 228 | | |
157 | 229 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | | - | |
| 18 | + | |
15 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | | - | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
0 commit comments