Skip to content

feat(compat.openblas): Windows support (import-lib + runtime DLL) + Windows CI#55

Merged
Sunrisepeak merged 2 commits into
mainfrom
feat/openblas-windows
Jun 29, 2026
Merged

feat(compat.openblas): Windows support (import-lib + runtime DLL) + Windows CI#55
Sunrisepeak merged 2 commits into
mainfrom
feat/openblas-windows

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

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 *.dll next 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 = gitcode mcpp-res/openblas, uploaded + GET-verified byte-equal, sha256 7ad797ef…). 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 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 (the asymmetry is intentional — only Windows ships a runtime DLL).

Windows CI (Phase D)

  • smoke_compat_portable.sh gains a Windows-only OpenBLAS build-AND-run: cblas_dgemm must produce exactly [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 0.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.

…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.
@Sunrisepeak Sunrisepeak merged commit 8145abc into main Jun 29, 2026
7 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/openblas-windows branch June 29, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant