RcppEigen icon indicating copy to clipboard operation
RcppEigen copied to clipboard

Upgrade to Eigen 5.0.0

Open jolars opened this issue 2 months ago • 5 comments

Eigen 5.0.0 was released recently. They changed versioning scheme, so the version bump is not as dramatic as it first seems.

Here's a list of the breaking changes. I suspect the requirement on C++14 may be the most problematic among these.

jolars avatar Nov 06 '25 06:11 jolars

Thanks for opening the issue; I also saw the note about 5.0.0 being really 3.5.0 in their old scheme. All makes sense.

I have my hands a little full with an ongoing large RcppArmadillo transition plus something new for Rcpp so if someone wants to lead this I would welcome it. I am sure we can coordinate it. Going to a minimum of C++14 should be viable: CRAN is also asking maintainers to remove C++11 requirements where possible. But there are always some old(er) packages...

RcppEigen has a few homegrown patches since the very early days that need to be carried forward but that is hopefully not too onerous.

eddelbuettel avatar Nov 06 '25 11:11 eddelbuettel

I noticed that there was also a 3.4.1 version released simultaneously with various bug fixes (https://libeigen.gitlab.io/news/eigen_3.4.1_released/). I'm not sure if it's worth to upgrade to it first, which I guess should be quite straight-forward in comparison.

I just upgraded one of my packages to Eigen 5.0.0 and it required a couple of compatibility work-arounds to get to work. For instance the move from Eigen::all to Eigen::placeholders::all, which I am guessing will be a common issue for many of the packages.

jolars avatar Nov 11 '25 15:11 jolars

I am more or less a placeholder maintainer here as Doug moved on to all things Julia a long time ago and I do not use Eigen in my own projects so this is always a bit of a re-learning curve ... but part of the "fun" is that we have a few local patches that need to be reapplied. See this directory for them and the howToDiff file.

I agree with you that going from 3.4.0 to 3.4.1 is probably a good idea before we tackle 3.5.0 aka 5.0.0. If you have some spare cycles, do you want to tackle trying to create a 3.4.1 branch? I am sure we can count on @yixuan (who has been instrumental in the past for version updates) and @jaganmn for additional sets of eyes and tips.

Getting 5.0.0 into CRAN should be possible but transitions (as Debian calls it when a change in package or library requires a coordinated 'wave' of updates) are work. I have been on a long one for (Rcpp)Armadillo and its move to C++14 for a while now (which should conclude soon as CRAN imposed a Deadline on a number of affected packages...). It requires a bit of planning, reverse dependency checking, PR / patch creation and care. Entirely doable. But new package work comes first, of course.

eddelbuettel avatar Nov 11 '25 15:11 eddelbuettel

Hi all, I'm a bit tied up this month, but may take a look some time in December. There are also users interested in the impact of Eigen 5.0.0 on my own Spectra package, e.g., https://github.com/yixuan/spectra/issues/183.

yixuan avatar Nov 12 '25 04:11 yixuan

I would prefer not to take the reins on this, at least not at the moment. But I'd be happy to help out with all the various patches that I suspect will need to be submitted to the various dependents once we start the upgrade process.

jolars avatar Nov 12 '25 11:11 jolars

I had a little bit of idle time and gave it a go -- new branch is here. It passes tests here, and passed the GitHub Actions (as can be expected, we only run Linux which I use locally too). Next up would be some tire-kicking and maybe seeing what r-universe gets (as it also run macOS and windows).

eddelbuettel avatar Dec 25 '25 23:12 eddelbuettel