Skip to content

feat(eigen): Feature System v2 — eigen_blas provider + use_blas/use_lapacke/mpl2only#52

Merged
Sunrisepeak merged 2 commits into
mainfrom
feat/eigen-feature-capabilities
Jun 29, 2026
Merged

feat(eigen): Feature System v2 — eigen_blas provider + use_blas/use_lapacke/mpl2only#52
Sunrisepeak merged 2 commits into
mainfrom
feat/eigen-feature-capabilities

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Brings compat.eigen onto mcpp's Feature System v2 (mcpp ≥ 0.0.69). Older mcpp ignores the new defines/requires/provides keys (skip-unknown), so the recipe stays parseable everywhere — the v2 behaviours are simply inert there.

Features

  • eigen_blas — compile Eigen's own reference BLAS (blas/*.cpp + blas/f2c/*.c) AND advertise the blas capability (provides = ["blas"]). Self-contained, no Fortran.
  • use_blasdefines = ["EIGEN_USE_BLAS"] + requires = ["blas"]: Eigen's kernels delegate to an external BLAS that the resolver binds.
  • use_lapackeEIGEN_USE_LAPACKE + requires = ["lapack"].
  • mpl2onlyEIGEN_MPL2_ONLY (no capability).

This fixes the original report: enabling Eigen's BLAS feature now actually emits -DEIGEN_USE_BLAS (not only -DMCPP_FEATURE_BLAS).

Mutual exclusion (documented in the recipe header)

eigen_blas and use_blas are opposite roles and must not be combined: compiling Eigen's own BLAS sources with -DEIGEN_USE_BLAS defined is self-contradictory (the blas/*_impl.h functype dispatch tables stop matching the by-value backend run signatures → [-fpermissive] on level2/level3). Use eigen_blas alone, or use_blas with a separate provider.

Verified (mcpp 0.0.69)

  • header-only mpl2only consumer builds + runs;
  • eigen_blas alone compiles;
  • compile_commands.json carries EIGEN_USE_BLAS / EIGEN_MPL2_ONLY.

Design: mcpp .agents/docs/2026-06-29-feature-capability-model-design.md.

…apacke/mpl2only

Requires mcpp >= 0.0.69 (feature defines + capabilities); older mcpp ignores the
new keys (skip-unknown), so the recipe stays parseable everywhere.

- eigen_blas  : compile Eigen's own reference BLAS AND advertise the 'blas'
                capability (provides=["blas"]).
- use_blas    : define EIGEN_USE_BLAS + requires=["blas"] — Eigen delegates to
                an external BLAS bound by the resolver.
- use_lapacke : define EIGEN_USE_LAPACKE + requires=["lapack"].
- mpl2only    : define EIGEN_MPL2_ONLY (no capability).

Header comment documents the provider-vs-consumer split and the verified mutual
exclusion: enabling eigen_blas + use_blas together is self-contradictory (the
blas/*_impl.h functype dispatch tables vs the -DEIGEN_USE_BLAS backend signature)
— use eigen_blas alone, or use_blas with a separate provider.

Verified on mcpp 0.0.69: header-only mpl2only consumer builds+runs; eigen_blas
alone compiles; compile_commands.json carries EIGEN_USE_BLAS / EIGEN_MPL2_ONLY.
…las')

The recipe renamed the BLAS-provider feature blas -> eigen_blas; update the
example's dependency spec to match (it referenced the now-removed 'blas',
failing the smoke). eigen_blas alone (no EIGEN_USE_BLAS) compiles cleanly.
@Sunrisepeak Sunrisepeak merged commit f08f9e7 into main Jun 29, 2026
6 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/eigen-feature-capabilities branch June 29, 2026 03:39
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