Skip to content

feat(compat.openblas): new package + eigen backend-openblas feature#54

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/compat-openblas-eigen-backend
Jun 29, 2026
Merged

feat(compat.openblas): new package + eigen backend-openblas feature#54
Sunrisepeak merged 1 commit into
mainfrom
feat/compat-openblas-eigen-backend

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Summary

Adds compat.openblas and wires Eigen's backend-openblas feature, completing the feature/capability closed loop (requires mcpp >= 0.0.72).

compat.openblas (new)

  • Builds OpenBLAS 0.3.33 from source via the xpkg install() hook (build-dep xim:make): make TARGET=GENERIC NO_FORTRAN=1 NO_LAPACK=1 NO_SHARED=1 USE_THREAD=0 USE_OPENMP=0 CC=gcc libslibopenblas.a. BLAS-only (LAPACK needs Fortran); portable C kernels; static.
  • provides = ["blas"], ldflags = ["-Llib", "-lopenblas"], exposes <cblas.h> — usable both as the blas capability provider for Eigen and as a standalone BLAS.
  • The anchor TU is emitted by install() (not generated_files), which is what makes mcpp run the hook before the build — same trigger as compat.xcb's generated xproto.c.
  • CN mirror: gitcode mcpp-res/openblas release 0.3.33 (sha256-verified, byte-matched).

compat.eigen — backend-openblas feature

implies use_blas (defines EIGEN_USE_BLAS + requires "blas") and pulls compat.openblas as a feature-dep. The resolver binds the single blas provider; -lopenblas links automatically.

Requires mcpp >= 0.0.72

EIGEN_USE_BLAS is an interface define that must reach the consumer's TUs (Eigen is header-only) — interface-define propagation landed in mcpp 0.0.72.

Validation

A consumer of compat.eigen[backend-openblas] builds, links libopenblas.a, pulls OpenBLAS dgemm_ (21 symbols — not Eigen's built-in GEMM), and runs (trace/sum output).

compat.openblas builds OpenBLAS 0.3.33 from source via its xpkg install() hook
(build-dep xim:make), BLAS-only (NO_FORTRAN/NO_LAPACK, TARGET=GENERIC, static),
producing libopenblas.a. It `provides = ["blas"]` and exposes <cblas.h>, so it
serves both as the `blas` capability provider for Eigen and as a standalone BLAS.
CN mirror: gitcode mcpp-res/openblas (sha256-verified).

compat.eigen gains a `backend-openblas` feature: `implies use_blas` (defines
EIGEN_USE_BLAS + requires the `blas` capability) and pulls compat.openblas as a
feature-dep. The resolver binds the single `blas` provider automatically and the
provider's -lopenblas links.

Requires mcpp >= 0.0.72: EIGEN_USE_BLAS is an interface define that must reach
the consumer's TUs (Eigen is header-only); interface-define propagation landed in
0.0.72. Validated end-to-end: a consumer of compat.eigen[backend-openblas] builds,
links libopenblas.a, pulls OpenBLAS dgemm_ (not Eigen's built-in GEMM), and runs.
@Sunrisepeak Sunrisepeak merged commit e1e3716 into main Jun 29, 2026
7 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/compat-openblas-eigen-backend branch June 29, 2026 09:50
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