|
| 1 | +-- Form B inline descriptor for Eigen — a C++ template library for linear |
| 2 | +-- algebra (matrices, vectors, numerical solvers, related algorithms). The |
| 3 | +-- Eigen *core* is HEADER-ONLY: there is nothing to compile for normal use, so |
| 4 | +-- the package exposes the source tree's root on the include path |
| 5 | +-- (`#include <Eigen/Dense>` etc.) and carries a tiny anchor translation unit |
| 6 | +-- so mcpp always has a buildable `lib` target (same shape as compat.opengl / |
| 7 | +-- compat.khrplatform). The optional `blas` feature additionally compiles |
| 8 | +-- Eigen's reference BLAS into that lib (see below). |
| 9 | +-- |
| 10 | +-- `include_dirs = {"*"}` points at the tarball root (`eigen-<ver>/`), which is |
| 11 | +-- exactly the directory upstream tells you to put on the include path. That |
| 12 | +-- makes BOTH the stable modules under `Eigen/` and the experimental modules |
| 13 | +-- under `unsupported/Eigen/` (Tensor, AutoDiff, Splines, MatrixFunctions, …) |
| 14 | +-- resolvable out of the box. |
| 15 | +-- |
| 16 | +-- Feature: `blas` — Eigen's reference BLAS implementation. |
| 17 | +-- Eigen ships a full BLAS library under `blas/` (the `eigen_blas` target in |
| 18 | +-- upstream CMake). Despite the historical name, it builds from pure C++ |
| 19 | +-- (`blas/*.cpp`) + f2c-translated C (`blas/f2c/*.c`) — NO Fortran compiler |
| 20 | +-- is needed (the only `.f` files live under `blas/testing/`, the test |
| 21 | +-- suite, and are not part of the library). So it fits mcpp's sources-only |
| 22 | +-- feature gate cleanly, exactly like compat.cjson's `utils`: excluded by |
| 23 | +-- default, and compiled into the `eigen` lib when the dependency requests |
| 24 | +-- `features = ["blas"]`. The result exposes the standard BLAS symbols |
| 25 | +-- (sgemm_/dgemm_/ddot_/… , Fortran ABI) for code that wants to link a BLAS. |
| 26 | +-- Common.h pulls Eigen via a path RELATIVE to blas/ (`../Eigen/Core`), so |
| 27 | +-- the sources must compile in place — they do, since `*/blas/*.cpp` keeps |
| 28 | +-- them under the unpacked tree. Verified locally on mcpp 0.0.68. |
| 29 | +-- |
| 30 | +-- What is NOT a feature here (and why): |
| 31 | +-- * `unsupported/` modules are header-only and live BESIDE `Eigen/` under |
| 32 | +-- the same tarball root, so the core include path (`*`) already exposes |
| 33 | +-- them; a sources-only gate cannot hide headers, so there is nothing to |
| 34 | +-- gate — they are simply available. |
| 35 | +-- * Eigen's compile-define knobs (EIGEN_MPL2_ONLY, EIGEN_USE_BLAS/LAPACKE, |
| 36 | +-- …) are preprocessor defines; the feature table carries only `sources` |
| 37 | +-- on mcpp 0.0.68, so they cannot be feature-gated yet. If mcpp later lets |
| 38 | +-- a feature contribute defines/cflags, `mpl2only` (-> -DEIGEN_MPL2_ONLY) |
| 39 | +-- would be the clean fit. |
| 40 | +-- |
| 41 | +-- All `mcpp` paths are GLOBS relative to the verdir; the leading `*` absorbs |
| 42 | +-- the GitLab archive's `eigen-<tag>/` wrap layer. |
| 43 | +package = { |
| 44 | + spec = "1", |
| 45 | + namespace = "compat", |
| 46 | + name = "compat.eigen", |
| 47 | + description = "C++ template library for linear algebra (header-only)", |
| 48 | + licenses = {"MPL-2.0"}, |
| 49 | + repo = "https://gitlab.com/libeigen/eigen", |
| 50 | + type = "package", |
| 51 | + |
| 52 | + xpm = { |
| 53 | + linux = { |
| 54 | + ["5.0.1"] = { |
| 55 | + url = { |
| 56 | + GLOBAL = "https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.tar.gz", |
| 57 | + CN = "https://gitcode.com/mcpp-res/eigen/releases/download/5.0.1/eigen-5.0.1.tar.gz", |
| 58 | + }, |
| 59 | + sha256 = "e9c326dc8c05cd1e044c71f30f1b2e34a6161a3b6ecf445d56b53ff1669e3dec", |
| 60 | + }, |
| 61 | + }, |
| 62 | + macosx = { |
| 63 | + ["5.0.1"] = { |
| 64 | + url = { |
| 65 | + GLOBAL = "https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.tar.gz", |
| 66 | + CN = "https://gitcode.com/mcpp-res/eigen/releases/download/5.0.1/eigen-5.0.1.tar.gz", |
| 67 | + }, |
| 68 | + sha256 = "e9c326dc8c05cd1e044c71f30f1b2e34a6161a3b6ecf445d56b53ff1669e3dec", |
| 69 | + }, |
| 70 | + }, |
| 71 | + windows = { |
| 72 | + ["5.0.1"] = { |
| 73 | + url = { |
| 74 | + GLOBAL = "https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.tar.gz", |
| 75 | + CN = "https://gitcode.com/mcpp-res/eigen/releases/download/5.0.1/eigen-5.0.1.tar.gz", |
| 76 | + }, |
| 77 | + sha256 = "e9c326dc8c05cd1e044c71f30f1b2e34a6161a3b6ecf445d56b53ff1669e3dec", |
| 78 | + }, |
| 79 | + }, |
| 80 | + }, |
| 81 | + |
| 82 | + mcpp = { |
| 83 | + language = "c++23", |
| 84 | + import_std = false, |
| 85 | + c_standard = "c11", |
| 86 | + -- Tarball root: exposes `Eigen/` (stable) and `unsupported/Eigen/` |
| 87 | + -- (experimental) to consumers writing `#include <Eigen/...>`. |
| 88 | + include_dirs = { "*" }, |
| 89 | + -- Header-only: a trivial anchor TU gives mcpp a buildable lib target. |
| 90 | + generated_files = { |
| 91 | + ["mcpp_generated/eigen_anchor.c"] = "int mcpp_compat_eigen_headers_anchor(void) { return 0; }\n", |
| 92 | + }, |
| 93 | + sources = { "mcpp_generated/eigen_anchor.c" }, |
| 94 | + targets = { ["eigen"] = { kind = "lib" } }, |
| 95 | + -- Optional: compile Eigen's reference BLAS (`eigen_blas`) into the lib. |
| 96 | + -- C++ + f2c-C only, no Fortran. Off by default; pulled in with |
| 97 | + -- `features = ["blas"]`. blas/ has exactly the 5 library .cpp and |
| 98 | + -- blas/f2c/ exactly the 18 library .c (the upstream eigen_blas source |
| 99 | + -- set); the `*.cpp`/`*.c` globs match them and nothing else. |
| 100 | + features = { |
| 101 | + ["blas"] = { |
| 102 | + sources = { |
| 103 | + "*/blas/*.cpp", |
| 104 | + "*/blas/f2c/*.c", |
| 105 | + }, |
| 106 | + }, |
| 107 | + }, |
| 108 | + deps = { }, |
| 109 | + }, |
| 110 | +} |
0 commit comments