feat(compat.openblas): Windows support (import-lib + runtime DLL) + Windows CI#55
Merged
Conversation
…ime DLL
Adds Windows to compat.openblas. OpenBLAS has no upstream Make path for the
MSVC-ABI Clang mcpp links with, so Windows uses the prebuilt x64 zip: link the
MSVC import lib (lib/libopenblas.lib) and ship the runtime DLL
(bin/libopenblas.dll) beside the consumer's .exe. mcpp >= 0.0.73 stages a
dependency's [runtime] library_dirs *.dll next to the executable (PE has no
RPATH), so the consumer launches standalone.
Recipe:
* xpm.windows: OpenBLAS-0.3.33-x64.zip (GLOBAL OpenMathLib GitHub; CN gitcode
mcpp-res/openblas, uploaded + GET-verified byte-equal). Unpacks to
bin/ lib/ include/ (no wrapper dir).
* mcpp ldflags are now per-OS (the synthesized-manifest parser APPENDS
ldflags, so a global -lopenblas would wrongly reach the Windows link):
linux/macosx link the static -lopenblas; windows links -llibopenblas
(clang MSVC maps it to libopenblas.lib).
* mcpp.windows: [runtime] library_dirs=["bin"] (DLL deploy) + a
generated_files anchor TU (no Make build on Windows). install() returns
immediately on windows; linux/macosx keep the source build.
CI (Phase D): smoke_compat_portable.sh gains a Windows-only OpenBLAS
build-AND-run — cblas_dgemm must produce [19 22; 43 50], and the produced .exe
is launched DIRECTLY from a neutral CWD so a clean exit proves the DLL was
actually deployed beside it (not merely found via mcpp run's PATH prepend).
MCPP_VERSION pinned 0.0.68 -> 0.0.73 (the release carrying DLL deployment).
See mcpp .agents/docs/2026-06-29-windows-runtime-dll-deployment-and-openblas.md.
The Phase D direct-launch assertion ran the .exe found by `find target` (a
path relative to the project dir) after `cd /`, so it resolved to a
nonexistent path ("No such file or directory") and failed even though the
build linked the import lib, deployed bin/libopenblas.dll beside the .exe (the
DLL-presence check passed), and `mcpp run` succeeded. Absolutise the exe path
(exedir via pwd + basename) before the neutral-CWD launch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Windows to
compat.openblas. OpenBLAS has no upstream Make path for the MSVC-ABI Clang mcpp links with, so Windows uses the prebuilt x64 zip: link the MSVC import lib (lib/libopenblas.lib) and ship the runtime DLL (bin/libopenblas.dll) beside the consumer's .exe. mcpp ≥ 0.0.73 stages a dependency's[runtime] library_dirs*.dllnext to the executable (PE has no RPATH), so a standalone launch finds it.Recipe (
pkgs/c/compat.openblas.lua)xpm.windows:OpenBLAS-0.3.33-x64.zip(GLOBAL = OpenMathLib GitHub; CN = gitcodemcpp-res/openblas, uploaded + GET-verified byte-equal, sha2567ad797ef…). Unpacks tobin/ lib/ include/(no wrapper dir).mcppldflags are now per-OS — the synthesized-manifest parser appends ldflags, so a global-lopenblaswould wrongly reach the Windows link. linux/macosx link static-lopenblas; windows links-llibopenblas(clang MSVC maps it tolibopenblas.lib).mcpp.windows:[runtime] library_dirs=["bin"](DLL deploy) + agenerated_filesanchor TU (no Make build on Windows).install()returns immediately on windows; linux/macosx keep the source build (the asymmetry is intentional — only Windows ships a runtime DLL).Windows CI (Phase D)
smoke_compat_portable.shgains a Windows-only OpenBLAS build-AND-run:cblas_dgemmmust produce exactly[19 22; 43 50], and the produced.exeis launched directly from a neutral CWD so a clean exit proves the DLL was actually deployed beside it (not merely found viamcpp run's PATH prepend).MCPP_VERSION0.0.68 → 0.0.73(the release carrying runtime-DLL deployment; mirrored + indexed).The Linux/macOS static-archive path is unchanged. See mcpp
.agents/docs/2026-06-29-windows-runtime-dll-deployment-and-openblas.md.