feat(pkgs): add Eigen 5.0.1 (compat, header-only) + CN mirror#50
Merged
Conversation
- compat.eigen @5.0.1 — latest Eigen (libeigen/eigen on GitLab; 5.x line).
Header-only: include_dirs={"*"} exposes the source root so `#include
<Eigen/Dense>` works out of the box; a trivial anchor TU gives mcpp a
buildable lib target (same shape as compat.opengl/khrplatform). Both the
stable `Eigen/` modules and the experimental `unsupported/Eigen/` modules
resolve from the single root (verified: MatrixFunctions + AutoDiff compile).
- CN mirror mcpp-res/eigen (GitCode), byte-identical to the GitLab archive
(sha256 e9c326dc…, http 200).
- feature mechanism: deliberately NOT used — analysis recorded in the
descriptor + design doc. mcpp 0.0.68 features gate sources only; Eigen is
header-only with no gateable source, and `unsupported/` shares the include
root with core so it can't be hidden behind a sources-only feature. Eigen's
other knobs (EIGEN_MPL2_ONLY, …) are compile defines the feature table can't
carry. Documented for a future define-capable feature gate.
- tests/examples/eigen/ minimal project (2x2 linear-algebra round-trip), wired
into the per-package CI selector (detect → smoke-examples (eigen)).
Verified locally on mcpp 0.0.68 (CI version, MCPP_INDEX_MIRROR=GLOBAL):
`tests/run_example.sh eigen` → `eigen ok=1 y=[3 7] det=-2 dot=5`.
Design: .agents/docs/2026-06-28-add-eigen-plan.md
Correcting the earlier "BLAS needs Fortran, too heavy → no feature" call: it
was wrong. Eigen's `eigen_blas` library (blas/CMakeLists.txt EigenBlas_SRCS)
builds from blas/*.cpp (5 files) + blas/f2c/*.c (18 f2c-translated C files);
the only .f files live under blas/testing/ (the test suite) and are NOT part
of the library. So it compiles with a plain C/C++ toolchain and fits mcpp's
sources-only feature gate exactly like compat.cjson's `utils`.
- compat.eigen: add `features = { blas = { sources = {"*/blas/*.cpp",
"*/blas/f2c/*.c"} } }`. Off by default; `features = ["blas"]` compiles
Eigen's reference BLAS into the eigen lib, exposing the standard Fortran-ABI
symbols (sgemm_/dgemm_/ddot_/…).
- example now opts into `blas` and calls dgemm_ to exercise the feature in CI
alongside the header-only core path.
Verified on mcpp 0.0.68:
- with feature: `eigen ok=1 core=1 blas(dgemm)=1 C=[1 3 2 4]`.
- without feature (negative): `undefined reference to 'dgemm_'` — gate works.
Descriptor comment + design doc updated with the corrected analysis.
Sunrisepeak
added a commit
that referenced
this pull request
Jun 28, 2026
Codifies the full process used for cjson/nlohmann/eigen into a reusable skill under .agents/skills/add-mcpp-index-package/: - SKILL.md — 12-step SOP, the sources-only feature gate (+ mandatory negative test), version-matched local verification, red-flags/common mistakes. - package-types.md — descriptor templates for the four shapes (C-source compat / header-only / C++23 module via generated wrapper / external Form-A module repo), each with real sample paths. - cn-mirror.md — gtc/gitcode mcpp-res mirror closed loop + every known gotcha. - references.md — repo layout, descriptor schema cheat-sheet, validate.yml CI behavior, one-shot local lint, real worked examples (#48 / #50).
Sunrisepeak
added a commit
that referenced
this pull request
Jun 28, 2026
Codifies the full process used for cjson/nlohmann/eigen into a reusable skill under .agents/skills/add-mcpp-index-package/: - SKILL.md — 12-step SOP, the sources-only feature gate (+ mandatory negative test), version-matched local verification, red-flags/common mistakes. - package-types.md — descriptor templates for the four shapes (C-source compat / header-only / C++23 module via generated wrapper / external Form-A module repo), each with real sample paths. - cn-mirror.md — gtc/gitcode mcpp-res mirror closed loop + every known gotcha. - references.md — repo layout, descriptor schema cheat-sheet, validate.yml CI behavior, one-shot local lint, real worked examples (#48 / #50).
Sunrisepeak
added a commit
that referenced
this pull request
Jun 28, 2026
* docs(skills): add `add-mcpp-index-package` agent skill (SOP) Codifies the full process used for cjson/nlohmann/eigen into a reusable skill under .agents/skills/add-mcpp-index-package/: - SKILL.md — 12-step SOP, the sources-only feature gate (+ mandatory negative test), version-matched local verification, red-flags/common mistakes. - package-types.md — descriptor templates for the four shapes (C-source compat / header-only / C++23 module via generated wrapper / external Form-A module repo), each with real sample paths. - cn-mirror.md — gtc/gitcode mcpp-res mirror closed loop + every known gotcha. - references.md — repo layout, descriptor schema cheat-sheet, validate.yml CI behavior, one-shot local lint, real worked examples (#48 / #50). * docs(readme): slim down to intro + usage + contribution + links Drop the package tables/dependency tree/smoke breakdown/Form-A-B examples from the index README — the browsable site (mcpplibs.github.io/mcpp-index) is the package list, and the how-to detail lives in the add-mcpp-index-package skill. README now = what it is, mcpp add/build usage, the two package categories (native module libs / third-party compat) with a pointer to the skill, and related tools / community. * docs: add docs/, README example table + agent prompt; skill mirror fallback - Move the skill's reference files into a human-facing docs/ folder (single source): package-types.md, cn-mirror.md, repository-and-schema.md (+ index docs/README.md). SKILL.md now links to ../../../docs/*; the skill dir keeps just SKILL.md (the agent SOP). - README: add a "参考示例" table linking typical descriptors by shape (Form-A module / C-source compat / header-only / module wrapper), a copy-paste agent prompt that drives the skill end-to-end, and links to docs/. - skill + docs: document the no-`mcpp-res`-permission fallback — use a plain-string upstream `url` (lint forbids a {GLOBAL,CN} table whose CN isn't gitcode/mcpp-res; plain strings are unconstrained). Real precedent: pkgs/t/tensorvia-cpu.lua. - skill step 1 now distinguishes the two sources: a third-party upstream lib vs. the user's own mcpp-based library (Form A, lighter research). * docs: rewrite README/docs/skill in a formal declarative register Rewrite all prose across README.md, docs/*, and the add-mcpp-index-package skill into declarative, academic-style Chinese: remove colloquial terms (一把梭 / 踩坑 / 丢给 / 硬凑 / 藏不住 …) and decorative emoji (⚠️ ✅❌📘✓), and reformulate fragments as complete declarative sentences. The red-flag table becomes a "错误做法 / 正确做法" table; section headings are normalized (e.g. "本地 lint 一把梭" → "本地 lint 复现(等价于 CI lint job)", "踩坑" → "注意事项", "CI 兜底" → "CI 保障"). Technical content, commands, code samples, and links are unchanged.
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.
参考 #48,收录最新 Eigen 5.0.1(
libeigen/eigen,GitLab,已跨入 5.x 大版本)为 compat 包,并补 GitCode CN 镜像。改动
pkgs/c/compat.eigen.lua— Eigen 5.0.1,header-only。include_dirs={"*"}暴露源码根目录,#include <Eigen/Dense>开箱即用;trivial anchor TU 提供可构建的lib目标(同compat.opengl/compat.khrplatform)。稳定
Eigen/与实验unsupported/Eigen/模块均从同一根目录可达(实测MatrixFunctions+AutoDiff可编)。mcpp-res/eigen(GitCode)— 与 GitLab 归档 byte-identical(sha256e9c326dc…,http 200)。tests/examples/eigen/— 最小工程(2×2 线代往返:A*x/ determinant / dot / QR solve),接入按改动库选跑 CI。eigen。关于 feature 机制(用户要求评估)
经核实 mcpp 0.0.68 源码:包描述符的
features表 只能门控sources。Eigen 是 header-only,没有可门控的可选源码;其天然可选轴
unsupported/与稳定核 同处 tarball 根,任何暴露核的 include path都会一并暴露它(无法用 sources-only 的 feature 把头藏起来)。其它开关(
EIGEN_MPL2_ONLY等)是编译 define,feature 表亦不能携带。故本期暴露完整头集、不加 feature,并在 descriptor 注释 + 设计文档完整记录分析;
待 mcpp 支持 define-capable feature 后,
mpl2only是干净接入点。详见.agents/docs/2026-06-28-add-eigen-plan.md。本地验证(mcpp 0.0.68,与 CI 同版本)
MCPP_INDEX_MIRROR=GLOBAL tests/run_example.sh eigen→eigen ok=1 y=[3 7] det=-2 dot=5,OK: eigen。unsupported/可达性:g++ -std=c++23 -I<root>编<Eigen/Dense> + <unsupported/Eigen/MatrixFunctions> + <AutoDiff>→ rc=0。