From a7e7f6912a7a37d74194a67a4f4b4e7e2ad4d1ac Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sat, 20 Sep 2025 15:49:23 -0700 Subject: [PATCH] [upstream_utils] Upgrade to Eigen 5.0.0 (#8240) --- upstream_utils/eigen.py | 4 ++-- .../native/thirdparty/eigen/include/Eigen/Core | 3 +++ .../native/thirdparty/eigen/include/Eigen/Version | 14 ++++++++++++++ .../eigen/include/Eigen/src/Core/util/Macros.h | 8 ++------ 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 wpimath/src/main/native/thirdparty/eigen/include/Eigen/Version diff --git a/upstream_utils/eigen.py b/upstream_utils/eigen.py index 6cb3facfa9..e343251160 100755 --- a/upstream_utils/eigen.py +++ b/upstream_utils/eigen.py @@ -77,6 +77,7 @@ def eigen_inclusions(dp: Path, f: str): "SparseLU", "SparseQR", "StdVector", + "Version", "misc", "plugins", ] @@ -144,8 +145,7 @@ def copy_upstream_src(wpilib_root: Path): def main(): name = "eigen" url = "https://gitlab.com/libeigen/eigen.git" - # master on 2025-09-08 - tag = "e0a59e5a66e6d16fa93ab4f5e48bf539205e837f" + tag = "5.0.0" eigen = Lib(name, url, tag, copy_upstream_src) eigen.main() diff --git a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/Core b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/Core index 2fedfd3b80..546625bb1f 100644 --- a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/Core +++ b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/Core @@ -11,6 +11,9 @@ #ifndef EIGEN_CORE_MODULE_H #define EIGEN_CORE_MODULE_H +// Eigen version information. +#include "Version" + // first thing Eigen does: stop the compiler from reporting useless warnings. #include "src/Core/util/DisableStupidWarnings.h" diff --git a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/Version b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/Version new file mode 100644 index 0000000000..de4a594adc --- /dev/null +++ b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/Version @@ -0,0 +1,14 @@ +#ifndef EIGEN_VERSION_H +#define EIGEN_VERSION_H + +// The "WORLD" version will forever remain "3" for the "Eigen3" library. +#define EIGEN_WORLD_VERSION 3 +// As of Eigen3 5.0.0, we have moved to Semantic Versioning (semver.org). +#define EIGEN_MAJOR_VERSION 5 +#define EIGEN_MINOR_VERSION 0 +#define EIGEN_PATCH_VERSION 0 +#define EIGEN_PRERELEASE_VERSION "dev" +#define EIGEN_BUILD_VERSION "master" +#define EIGEN_VERSION_STRING "5.0.0-dev+master" + +#endif // EIGEN_VERSION_H diff --git a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h index 9198555973..35eb161361 100644 --- a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h +++ b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h @@ -17,13 +17,9 @@ // Eigen version and basic defaults //------------------------------------------------------------------------------------------ -#define EIGEN_WORLD_VERSION 3 -#define EIGEN_MAJOR_VERSION 4 -#define EIGEN_MINOR_VERSION 90 - #define EIGEN_VERSION_AT_LEAST(x, y, z) \ - (EIGEN_WORLD_VERSION > x || \ - (EIGEN_WORLD_VERSION >= x && (EIGEN_MAJOR_VERSION > y || (EIGEN_MAJOR_VERSION >= y && EIGEN_MINOR_VERSION >= z)))) + (EIGEN_MAJOR_VERSION > x || \ + (EIGEN_MAJOR_VERSION >= x && (EIGEN_MINOR_VERSION > y || (EIGEN_MINOR_VERSION >= y && EIGEN_PATCH_VERSION >= z)))) #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor