Strip lapacke.h to only the declarations used by Eigen
Summary
- Remove 948 unused LAPACKE function declarations from
Eigen/src/misc/lapacke.h - Keep only the 32 declarations (8 routines × 4 type variants) Eigen actually calls:
potrf,getrf,geqrf,geqp3,gees,gesdd,gesvd,syev/heev - Preserve all required type definitions, constants, callback typedefs, and name mangling macros
- 10,085 lines (860KB) → 218 lines (~8KB) — 97.8% reduction
This eliminates a major source of conflicts with system LAPACK headers (non-standard const qualifiers, missing parameters) reported in the issue.
Test plan
Local Docker (GCC 15, CMake 3.31, Debian trixie, C++17):
| Test suite | Tests | Result |
|---|---|---|
eigen_blas |
library build |
|
eigen_lapack |
shared library build |
|
cholesky |
6 variants |
|
lu |
2 variants |
|
inverse |
5 variants |
|
qr |
7 variants |
|
eigensolver_selfadjoint |
13 variants |
|
eigensolver_generic |
5 variants |
|
product_large |
9 variants |
|
| Total | 42 tests + 2 library builds | 42/42 pass |
Closes #2851 (closed)
Edited by Pavel Guzenfeld