dev-cpp/eigen: C++20 compatibility updates

Force early evaluation of boost::multiprecision::detail::expression-s.

casting boost::multiprecision::detail::expression-s into the proper
type for the Eigen methods solves the issue.

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/45043
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44994
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Nicholas Vinson
2025-12-15 20:37:04 -05:00
committed by Sam James
parent 2bc125639a
commit e3f9d81a4a
6 changed files with 65 additions and 0 deletions

View File

@@ -219,6 +219,8 @@ PATCHES=(
"${FILESDIR}/${PN}-3.4.0-buildstring.patch"
"${FILESDIR}/${PN}-3.4.1-cxxstandard-17.patch"
"${FILESDIR}/${PN}-3.4.0-c++-20.patch"
"${FILESDIR}/${PN}-3.4.1-bug1213-link-with-Eigen3-Eigen.patch"
"${FILESDIR}/${PN}-5.0.1-cmake-GNUInstallDirs.patch"

View File

@@ -219,6 +219,8 @@ PATCHES=(
"${FILESDIR}/${PN}-3.4.0-buildstring.patch"
"${FILESDIR}/${PN}-3.4.1-cxxstandard-17.patch"
"${FILESDIR}/${PN}-3.4.0-c++-20.patch"
"${FILESDIR}/${PN}-3.4.1-bug1213-link-with-Eigen3-Eigen.patch"
"${FILESDIR}/${PN}-5.0.1-cmake-GNUInstallDirs.patch"

View File

@@ -221,6 +221,7 @@ PATCHES=(
# PRs
"${FILESDIR}/${PN}-5.0.0-doxygen-1.14.patch"
"${FILESDIR}/${PN}-5.0.1-c++-20.patch"
"${FILESDIR}/${PN}-5.0.1-cmake-GNUInstallDirs.patch"
"${FILESDIR}/${PN}-5.0.1-make-static-libs-optional.patch"

View File

@@ -221,6 +221,7 @@ PATCHES=(
# PRs
"${FILESDIR}/${PN}-5.0.0-doxygen-1.14.patch"
"${FILESDIR}/${PN}-5.0.1-c++-20.patch"
"${FILESDIR}/${PN}-5.0.1-cmake-GNUInstallDirs.patch"
"${FILESDIR}/${PN}-5.0.1-make-static-libs-optional.patch"

View File

@@ -0,0 +1,30 @@
From: Nicholas Vinson <nvinson234@gmail.com>
Date: Mon, 15 Dec 2025 20:37:04 -0500
--- a/Eigen/src/Eigenvalues/ComplexSchur.h
+++ b/Eigen/src/Eigenvalues/ComplexSchur.h
@@ -277,7 +277,8 @@
using std::abs;
if ((iter == 10 || iter == 20) && iu > 1) {
// exceptional shift, taken from http://www.netlib.org/eispack/comqr.f
- return abs(numext::real(m_matT.coeff(iu,iu-1))) + abs(numext::real(m_matT.coeff(iu-1,iu-2)));
+ return ComplexSchur<MatrixType>::ComplexScalar(
+ abs(numext::real(m_matT.coeff(iu, iu - 1))) + abs(numext::real(m_matT.coeff(iu - 1, iu - 2))));
}
// compute the shift as one of the eigenvalues of t, the 2x2
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
@@ -86,8 +86,8 @@
for (Index i = 0; i < rows; i++)
mx = (std::max)(mx, std::abs(m_f(Ashifted(i, i) + avgEival, static_cast<int>(s + r))));
if (r != 0)
rfactorial *= RealScalar(r);
- delta = (std::max)(delta, mx / rfactorial);
+ delta = (std::max)(delta, RealScalar(mx / rfactorial));
}
const RealScalar P_norm = P.cwiseAbs().rowwise().sum().maxCoeff();
if (mu * delta * P_norm < NumTraits<Scalar>::epsilon() * F_norm) // series converged
--
2.52.0

View File

@@ -0,0 +1,29 @@
From: Nicholas Vinson <nvinson234@gmail.com>
Date: Mon, 15 Dec 2025 20:37:04 -0500
--- a/Eigen/src/Eigenvalues/ComplexSchur.h
+++ b/Eigen/src/Eigenvalues/ComplexSchur.h
@@ -277,7 +277,8 @@
using std::abs;
if ((iter == 10 || iter == 20) && iu > 1) {
// exceptional shift, taken from http://www.netlib.org/eispack/comqr.f
- return abs(numext::real(m_matT.coeff(iu, iu - 1))) + abs(numext::real(m_matT.coeff(iu - 1, iu - 2)));
+ return ComplexSchur<MatrixType>::ComplexScalar(
+ abs(numext::real(m_matT.coeff(iu, iu - 1))) + abs(numext::real(m_matT.coeff(iu - 1, iu - 2))));
}
// compute the shift as one of the eigenvalues of t, the 2x2
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
@@ -86,7 +86,7 @@
for (Index i = 0; i < rows; i++)
mx = (std::max)(mx, std::abs(m_f(Ashifted(i, i) + avgEival, static_cast<int>(s + r))));
if (r != 0) rfactorial *= RealScalar(r);
- delta = (std::max)(delta, mx / rfactorial);
+ delta = (std::max)(delta, RealScalar(mx / rfactorial));
}
const RealScalar P_norm = P.cwiseAbs().rowwise().sum().maxCoeff();
if (mu * delta * P_norm < NumTraits<Scalar>::epsilon() * F_norm) // series converged
--
2.52.0