Repository navigation
Add Windows OpenCL CI via pocl - #1338
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.0 #1338 +/- ##
=======================================
Coverage ? 94.00%
=======================================
Files ? 19
Lines ? 9232
Branches ? 0
=======================================
Hits ? 8679
Misses ? 553
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks! I rebased this to target the v1.0 branch (it hasn't been merged to master yet) and am going to rerun CI. |
jgabry
left a comment
There was a problem hiding this comment.
Thanks! One real change suggested and then one option nitpick.
| $prefix = "$env:MSYS2_LOCATION/$($env:MSYSTEM.ToLowerInvariant())" | ||
| "$prefix/bin" >> $env:GITHUB_PATH | ||
| # Avoid mixing MSYS2 and Rtools runtime libraries via -L. | ||
| "LDLIBS_OPENCL='$prefix/lib/libOpenCL.dll.a'" >> $env:GITHUB_ENV |
There was a problem hiding this comment.
| "LDLIBS_OPENCL='$prefix/lib/libOpenCL.dll.a'" >> $env:GITHUB_ENV | |
| "LDLIBS_OPENCL='$($prefix.Replace('\', '/'))/lib/libOpenCL.dll.a'" >> $env:GITHUB_ENV |
The failures on the two OpenCL Windows jobs are all Rcpp::sourceCpp() builds (model methods and exposed functions), and they seem to come from the backslashes in this path:
LDLIBS_OPENCL='D:\a\_temp\msys64/ucrt64/lib/libOpenCL.dll.a'
I asked Claude to look into it:
Stan Math appends
$(LDLIBS_OPENCL)toLDLIBSwhether or notSTAN_OPENCLis set, so every link gets it. CmdStan's make keeps the quotes, so compiling models works, but cmdstanr reads the flags withmake print-LDLIBS(echo drops the quotes) and passes the value to R CMD SHLIB inPKG_LIBS, where sh eats the backslashes:ld.exe: cannot find D:a_tempmsys64/ucrt64/lib/libOpenCL.dll.aForward slashes in this one value should fix it. The PATH entry and
the registry value can stay as they are, since the OpenCL tests passed
with them:"LDLIBS_OPENCL='$($prefix.Replace('\', '/'))/lib/libOpenCL.dll.a'" >> $env:GITHUB_ENV
There was a problem hiding this comment.
I'm going to go ahead and make this change so that it reruns CI and we can see if it passes. Can always revert if necessary
There was a problem hiding this comment.
Looks like that worked, will merge now
cmdstanr reads LDLIBS with make print-LDLIBS, which drops the quotes, and passes it to R CMD SHLIB, where sh drops the backslashes from the MSYS2 location.
Submission Checklist
Summary
I've added a recipe for PoCL to MSYS so we can also run the windows opencl tests in CI.
Windows OpenCL is a bit of a pain in that it requires a registry entry instead of just looking in the PATH when running in an elevated shell (which GHA does), which is why the changes in this PR don't just update the PATH like the other platforms
Copyright and Licensing
Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Andrew Johnson
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses: