diff --git a/upstream_utils/eigen_patches/0001-Disable-warnings.patch b/upstream_utils/eigen_patches/0001-Disable-warnings.patch index 9a8f2ab0fd..449b4a4f30 100644 --- a/upstream_utils/eigen_patches/0001-Disable-warnings.patch +++ b/upstream_utils/eigen_patches/0001-Disable-warnings.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Wed, 18 May 2022 09:14:24 -0700 -Subject: [PATCH 1/3] Disable warnings +Subject: [PATCH 1/4] Disable warnings --- Eigen/src/Core/util/DisableStupidWarnings.h | 9 +++++++++ diff --git a/upstream_utils/eigen_patches/0002-Intellisense-fix.patch b/upstream_utils/eigen_patches/0002-Intellisense-fix.patch index 2c7d477f29..cf15cf9421 100644 --- a/upstream_utils/eigen_patches/0002-Intellisense-fix.patch +++ b/upstream_utils/eigen_patches/0002-Intellisense-fix.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 20 Jan 2023 23:41:56 -0800 -Subject: [PATCH 2/3] Intellisense fix +Subject: [PATCH 2/4] Intellisense fix --- Eigen/src/Core/util/ConfigureVectorization.h | 7 +++++++ diff --git a/upstream_utils/eigen_patches/0003-Suppress-C-23-deprecation-warnings-for-std-has_denor.patch b/upstream_utils/eigen_patches/0003-Suppress-C-23-deprecation-warnings-for-std-has_denor.patch index 09b9baed56..a7d0cf59e6 100644 --- a/upstream_utils/eigen_patches/0003-Suppress-C-23-deprecation-warnings-for-std-has_denor.patch +++ b/upstream_utils/eigen_patches/0003-Suppress-C-23-deprecation-warnings-for-std-has_denor.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 13 May 2024 12:46:15 -0700 -Subject: [PATCH 3/3] Suppress C++23 deprecation warnings for std::has_denorm +Subject: [PATCH 3/4] Suppress C++23 deprecation warnings for std::has_denorm and std::has_denorm_loss --- diff --git a/upstream_utils/eigen_patches/0004-Fix-compilation-failures-on-constexpr-matrices-with-.patch b/upstream_utils/eigen_patches/0004-Fix-compilation-failures-on-constexpr-matrices-with-.patch new file mode 100644 index 0000000000..35f57d25c9 --- /dev/null +++ b/upstream_utils/eigen_patches/0004-Fix-compilation-failures-on-constexpr-matrices-with-.patch @@ -0,0 +1,48 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tyler Veness +Date: Tue, 14 May 2024 14:53:02 -0700 +Subject: [PATCH 4/4] Fix compilation failures on constexpr matrices with GCC + 14 + +DenseBase must have a trivial default constructor. +`constexpr DenseBase() {}` is not sufficient. +--- + Eigen/src/Core/DenseBase.h | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h +index 5ab54efa3d8d454b2d5e02cb9d6145a723683b91..297c42679d978c36388ccba5831dab6624b6cb92 100644 +--- a/Eigen/src/Core/DenseBase.h ++++ b/Eigen/src/Core/DenseBase.h +@@ -621,20 +621,20 @@ class DenseBase + protected: + EIGEN_DEFAULT_COPY_CONSTRUCTOR(DenseBase) + /** Default constructor. Do nothing. */ +- EIGEN_DEVICE_FUNC constexpr DenseBase() { +- /* Just checks for self-consistency of the flags. +- * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down +- */ + #ifdef EIGEN_INTERNAL_DEBUGGING +- EIGEN_STATIC_ASSERT( +- (internal::check_implication(MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1, int(IsRowMajor)) && +- internal::check_implication(MaxColsAtCompileTime == 1 && MaxRowsAtCompileTime != 1, int(!IsRowMajor))), +- INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION) ++ EIGEN_DEVICE_FUNC constexpr DenseBase(){ ++ /* Just checks for self-consistency of the flags. ++ * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down ++ */ ++ EIGEN_STATIC_ASSERT( ++ (internal::check_implication(MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1, int(IsRowMajor)) && ++ internal::check_implication(MaxColsAtCompileTime == 1 && MaxRowsAtCompileTime != 1, int(!IsRowMajor))), ++ INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)} ++#else ++ EIGEN_DEVICE_FUNC constexpr DenseBase() = default; + #endif +- } + +- private: +- EIGEN_DEVICE_FUNC explicit DenseBase(int); ++ private : EIGEN_DEVICE_FUNC explicit DenseBase(int); + EIGEN_DEVICE_FUNC DenseBase(int, int); + template + EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase&); diff --git a/upstream_utils/update_eigen.py b/upstream_utils/update_eigen.py index b97a6858cb..f031e44fef 100755 --- a/upstream_utils/update_eigen.py +++ b/upstream_utils/update_eigen.py @@ -110,6 +110,7 @@ def main(): "0001-Disable-warnings.patch", "0002-Intellisense-fix.patch", "0003-Suppress-C-23-deprecation-warnings-for-std-has_denor.patch", + "0004-Fix-compilation-failures-on-constexpr-matrices-with-.patch", ]: git_am(os.path.join(wpilib_root, "upstream_utils/eigen_patches", f)) diff --git a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/DenseBase.h b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/DenseBase.h index 5ab54efa3d..297c42679d 100644 --- a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/DenseBase.h +++ b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/DenseBase.h @@ -621,20 +621,20 @@ class DenseBase protected: EIGEN_DEFAULT_COPY_CONSTRUCTOR(DenseBase) /** Default constructor. Do nothing. */ - EIGEN_DEVICE_FUNC constexpr DenseBase() { - /* Just checks for self-consistency of the flags. - * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down - */ #ifdef EIGEN_INTERNAL_DEBUGGING - EIGEN_STATIC_ASSERT( - (internal::check_implication(MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1, int(IsRowMajor)) && - internal::check_implication(MaxColsAtCompileTime == 1 && MaxRowsAtCompileTime != 1, int(!IsRowMajor))), - INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION) + EIGEN_DEVICE_FUNC constexpr DenseBase(){ + /* Just checks for self-consistency of the flags. + * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down + */ + EIGEN_STATIC_ASSERT( + (internal::check_implication(MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1, int(IsRowMajor)) && + internal::check_implication(MaxColsAtCompileTime == 1 && MaxRowsAtCompileTime != 1, int(!IsRowMajor))), + INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)} +#else + EIGEN_DEVICE_FUNC constexpr DenseBase() = default; #endif - } - private: - EIGEN_DEVICE_FUNC explicit DenseBase(int); + private : EIGEN_DEVICE_FUNC explicit DenseBase(int); EIGEN_DEVICE_FUNC DenseBase(int, int); template EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase&);