ITK icon indicating copy to clipboard operation
ITK copied to clipboard

Update to newer eigen when available

Open jhlegarreta opened this issue 3 years ago • 23 comments

Description

Warnings related to unused eigen symbols are being reported since a while on some of the platforms builds, e.g. https://open.cdash.org/viewBuildError.php?type=1&buildid=8095196

All RogueResearch sites, which use Apple Clang, show these build warnings.

Steps to Reproduce

  1. Download ITK
  2. Configure
  3. Build using Apple Clang

Expected behavior

No warnings are present when building ITK.

Actual behavior

A few build warnings are reported when compiling ITK with Apple Clang.

Reproducibility

%100

Versions

ITK master.

Environment

OS: macOS (different versions: 10.x, 11, 12) CMake: (?) Compiler: Apple Clang

Additional Information

Related to: https://github.com/InsightSoftwareConsortium/ITK/commit/9d9b4165c3fd66746d9c77ed5804190afac817dc

The MR https://gitlab.com/libeigen/eigen/-/merge_requests/864 related to the referenced issue https://gitlab.com/libeigen/eigen/-/issues/2416 was merged to eigen master on March, 3 2022

Last eigen update in ITK: https://github.com/InsightSoftwareConsortium/ITK/pull/3133 (eigen 3.4).

Unfortunately, there hasn't been yet a new release since then (August 18, 2021)

jhlegarreta avatar Aug 12 '22 13:08 jhlegarreta

CC @seanm @phcerdan

jhlegarreta avatar Aug 12 '22 13:08 jhlegarreta

Relevant information: https://gitlab.com/libeigen/eigen/-/milestones https://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2021/09/msg00000.html

jhlegarreta avatar Sep 01 '22 00:09 jhlegarreta

Those eigen warnings are still on cdash. IIRC I fixed some of them upstream in eigen itself.

It looks like their last release is still 3.4 from 2021: https://gitlab.com/libeigen/eigen/-/releases

I found a ticket pushing for a new release: https://gitlab.com/libeigen/eigen/-/issues/2699

seanm avatar Oct 13 '23 20:10 seanm

Thanks for the follow-up Sean. It looks like the library gets commits regularly; not sure why no new releases have been cut.

jhlegarreta avatar Oct 13 '23 21:10 jhlegarreta

Given the lack of Eigen releases, another option is to update ITK to use Eigen master (we ping/freeze the commit we use). This would be a major upgrade of Eigen, but we don't have much code using it, and we don't use any fancy feature, so it's doable to keep up to date with upstream.

This way we can also fix warning upstream rapidly. Now, we have to backport them to 3.4.

phcerdan avatar Oct 13 '23 23:10 phcerdan

@phcerdan sounds like a good plan to me. Is someone familiar with syncing to eigen?

seanm avatar Oct 14 '23 00:10 seanm

I can help with that, I will open PR next week.

phcerdan avatar Oct 14 '23 09:10 phcerdan

Opened PR #4265 updating to eigen master. Hitting long-existing issue when updating ThirdParty modules, but I think the update went well, but still work in progress.

phcerdan avatar Oct 22 '23 22:10 phcerdan

@N-Dekker realized that there is a 3.4.1 branch in #4265.

It seems promising, maybe they are working on a new release. The current last release was from years ago.

Not sure, good to discuss what we prefer, master or this 3.4.1 branch.

I tend to prefer master, living at the head philosophy. It might be a bit bumpy at the start, but we can solve our warnings way faster this way.

But beyond that, I am open to whatever we decide! Pinging @seanm @thewtex @jhlegarreta @dzenanz.

phcerdan avatar Oct 23 '23 14:10 phcerdan

In general, I'm in favor of using a tagged version (of any library), as it is usually more stable, more carefully maintained, tested, and documented than just any arbitrary revision from the main/master branch. So I don't really embrace that so-called "living at the head philosophy". Maybe for experimental software, but not for a stable ITK release. What do you think?

PS If there is a specific reason for a specific third party library to use a particular revision from its commit history, instead of a tagged version, of course, I can understand that, as an exception to the rule.

N-Dekker avatar Oct 23 '23 15:10 N-Dekker

In general I also prefer a tagged release, with the hope/idea being that the project has done some QA and polish before giving it a formal tag.

But the eigen project does not seem to work this way. 2+ years with no release at all.

How much work is it to update eigen in ITK? If small, we could go to tip of the 3.4.1 branch first, digest that, then go to master (which I suspect would be necessary honestly).

I've just asked about the state of master here: https://gitlab.com/libeigen/eigen/-/issues/2699

seanm avatar Oct 23 '23 15:10 seanm

Great question upstream @seanm. Let's see their answer! Eigen is header-only, and we only pull the core subset in our third-party updates.

phcerdan avatar Oct 23 '23 15:10 phcerdan

I prefer a tagged version, but given the circumstances I ignore the benefit of going towards 3.4.1 over the current tip (besides concerns about the leap to the current tip being too much): we have no guarantee that 3.4.1 will be made into a tag.

jhlegarreta avatar Oct 24 '23 01:10 jhlegarreta

Given that the upstream ticket I commented on is 3 months old, has 16 thumbs up, but no actual answers in 3 months, I think we'll just have to make our own decision.

seanm avatar Oct 25 '23 15:10 seanm

So assuming we prefer a tagged version,

  • Staying on the current tip may be a little bit too much, since if a version is tagged and released (e.g. 3.4.1), it may not be at the current tip, and downgrading may be an issue (?).
  • If we know which commits are enough to make the warnings go away, maybe we could choose to stay with the head commit that is just enough to remove the warnings. IIRC, @seanm you did some PRs to address them, so I assume it should not be hard to find such commits.

jhlegarreta avatar Oct 26 '23 14:10 jhlegarreta

Checking last commits of Eigen, most of them address minor warnings, for different compilers or different architectures. Or refactor code. They don't seem to introduce breaking changes. Our CI checks pass on current master #4265.

I think their master is not the type of breaking changes, but more of a flow of continuous minor fixes, with big bumps when a new hardware architecture, or bridging to new types. We don't use those internally, and don't get affected if there are bugs on those.

Their master requires c++14, but that's something that ITK already requires.

I agree that the optimal would be to stay on a well maintained release, where upstream backports from master to their latest release, but that's not happening in Eigen in a fast way. It's a bit cumbersome having to maintain those in our fork.

phcerdan avatar Oct 27 '23 16:10 phcerdan

Staying on the current tip may be a little bit too much, since if a version is tagged and released (e.g. 3.4.1), it may not be at the current tip, and downgrading may be an issue (?).

If we are ok in our commit in master, we don't need to go back. I hope the release would be ahead of the sha we have frozen. But in any case, we can always downgrade (it's a bit more complicated, but doable).

If we know which commits are enough to make the warnings go away, maybe we could choose to stay with the head commit that is just enough to remove the warnings. IIRC, @seanm you did some PRs to address them, so I assume it should not be hard to find such commits.

Sure, but then, why don't go the tip? They have CI/CD, and if they see something broken, they will fix it, and we will follow. I think the HEAD of master is better than master~100.

phcerdan avatar Oct 27 '23 16:10 phcerdan

I vote to use their master.

seanm avatar Oct 27 '23 17:10 seanm

+1 for master.

dzenanz avatar Oct 27 '23 17:10 dzenanz

OK for master then.

jhlegarreta avatar Oct 29 '23 00:10 jhlegarreta

Still going to give this a try @phcerdan ?

seanm avatar Nov 09 '23 21:11 seanm

There is an ongoing PR: #4265.

dzenanz avatar Nov 09 '23 21:11 dzenanz

I thought so! Somehow lost track of it. Thx.

seanm avatar Nov 09 '23 22:11 seanm

I believe this can be closed now?

seanm avatar Apr 30 '24 16:04 seanm

If you can't close this yourself @seanm, then @jhlegarreta and @N-Dekker can, and possibly @phcerdan too.

dzenanz avatar Apr 30 '24 16:04 dzenanz

Looks like I could close it myself, but not sure of the etiquette. Generally I defer to the creator of the ticket to decide if it's fixed or not...

seanm avatar Apr 30 '24 16:04 seanm

OK, my bad. Should have closed it when the PR was merged. Sorry. Thanks for having kept an eye Sean.

jhlegarreta avatar Apr 30 '24 22:04 jhlegarreta