feat(compat.openblas): new package + eigen backend-openblas feature#54
Merged
Conversation
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.
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 compat.openblas and wires Eigen's backend-openblas feature, completing the feature/capability closed loop (requires mcpp >= 0.0.72).
compat.openblas (new)
install()hook (build-depxim:make):make TARGET=GENERIC NO_FORTRAN=1 NO_LAPACK=1 NO_SHARED=1 USE_THREAD=0 USE_OPENMP=0 CC=gcc libs→libopenblas.a. BLAS-only (LAPACK needs Fortran); portable C kernels; static.provides = ["blas"],ldflags = ["-Llib", "-lopenblas"], exposes<cblas.h>— usable both as theblascapability provider for Eigen and as a standalone BLAS.install()(notgenerated_files), which is what makes mcpp run the hook before the build — same trigger as compat.xcb's generatedxproto.c.mcpp-res/openblasrelease 0.3.33 (sha256-verified, byte-matched).compat.eigen — backend-openblas feature
implies use_blas(definesEIGEN_USE_BLAS+requires "blas") and pullscompat.openblasas a feature-dep. The resolver binds the singleblasprovider;-lopenblaslinks automatically.Requires mcpp >= 0.0.72
EIGEN_USE_BLASis 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, linkslibopenblas.a, pulls OpenBLASdgemm_(21 symbols — not Eigen's built-in GEMM), and runs (trace/sumoutput).