-
Notifications
You must be signed in to change notification settings - Fork 148
Update ITK to v5.2.0 to fix error during OpenJPEG build #425
base: master
Are you sure you want to change the base?
Conversation
ITK fixed a critical build error when compiling OpenJPEG as reported here: InsightSoftwareConsortium/ITK#1967 Update ITK to the current latest version, which includes this fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much David. Actually I just encountered the very same compilation error, this afternoon!
@kaspermarstal @ViktorvdValk Is it also fine to you to upgrade to ITK 5.2.0? And do you happen to know why the CI rejected this pull request?
ITK fixed a critical build error when compiling OpenJPEG as reported here, by spacelg: "ITK failed to build due to error C2169: 'lrintf': intrinsic function, cannot be defined with MSVC on windows" issue InsightSoftwareConsortium/ITK#1967 Update ITK to version 5.2.0 (whose release is about to be announced), which includes this fix. Following pull request SuperElastix/SimpleElastix#425 by David Young (yoda-vid)
FYI, We're preparing to upgrade ITK for elastix as well: https://github.com/SuperElastix/elastix/tree/Upgrade-ITK-to-v5.2.0 |
Great! I hope this might be helpful at least for troubleshooting. |
@yoda-vid For what it's worth, I reproduced the original compilation error at https://godbolt.org/z/rbnsxarYW
Compiler command line: Output:
Compiler version:
|
For the record, the This commit is included with OpenJPEG tag v2.1.1 |
This is really cool, thanks for sleuthing that out! So from my understanding:
Seems to make sense now why my previous build of SimpleElastix (on commit 2a79d15) with Visual Studio 2019 (MSVC 14.22.27905) worked, whereas my recent build on the same commit did not on MSVC 14.28.29910. |
@yoda-vid Well summarized, David 😃 By the way, ITK's fix is not entirely complete, as it defines |
Good to know! At least we will have a place to start looking if the builds start to break on Clang or GCC. |
Great, thanks @yoda-vid! Could you make the PR against develop instead of master? Develop was just updated to SimpleITK v2.0.2 and I hope to merge into master soon. Better check these changes are compatible :) |
Change ITK to the current latest version, which includes this fix. Rebased to `develop` branch from PR SuperElastix#425 .
Thanks, @kaspermarstal ! I made a new PR on |
ITK fixed a critical build error when compiling OpenJPEG as reported here, by spacelg: "ITK failed to build due to error C2169: 'lrintf': intrinsic function, cannot be defined with MSVC on windows" issue InsightSoftwareConsortium/ITK#1967 Update ITK to version 5.2.0 (whose release is about to be announced), which includes this fix. Following pull request SuperElastix/SimpleElastix#425 by David Young (yoda-vid)
Upgraded to ITK version 5.2.0, which was released on May 28, 2021. ITK 5.2.0 fixed a critical issue, with commit InsightSoftwareConsortium/ITK@7cebc26 "COMP: Fix OpenJPEG build error with Visual Studio 16.9", by James Butler (jamesobutler) and spacelg Following pull request SuperElastix/SimpleElastix#425 and SuperElastix/SimpleElastix#428 by David Young (yoda-vid) Obviously, ITK 5.2.0 has many other improvements: https://github.com/InsightSoftwareConsortium/ITK/releases/tag/v5.2.0
Upgraded to ITK version 5.2.0, which was released on May 28, 2021. ITK 5.2.0 fixed a critical issue, with commit InsightSoftwareConsortium/ITK@7cebc26 "COMP: Fix OpenJPEG build error with Visual Studio 16.9", by James Butler (jamesobutler) and spacelg Following pull request SuperElastix/SimpleElastix#425 and SuperElastix/SimpleElastix#428 by David Young (yoda-vid) Obviously, ITK 5.2.0 has many other improvements: https://github.com/InsightSoftwareConsortium/ITK/releases/tag/v5.2.0
Hi, not sure if this issue has solved or not for simpleElastix. I tried with both the master branch and the develop branch over the weekend, but the issue still exists. error C2169 repeated 19 times. Is there a solution? An old version (early 2020) of the package would also work for me. Is there a way to clone that? Thanks a million! |
As a quick-fix you may simply remove both static HTH, Niels |
This is good to know, thanks @N-Dekker! Just to add on, the build is working in PR #428 on
(Assuming |
This ITK update fixes a build error I encountered on Windows using Microsoft Visual Studio 16.9.3. The error occurs while compiling OpenJPEG for ITK with this message (multiple times):
This error appears to the be the same as the one fixed recently in ITK:
InsightSoftwareConsortium/ITK#1967
InsightSoftwareConsortium/ITK#2388
I do not know of a way to pull this fix into SimpleElastix other than to pull in a more recent ITK commit (if there's another way, please let me know!). I simply bumped the tag from v5.1rc02 to v5.2.0 since this appears to be the only tag currently with this fix. I also found this update in SimpleITK (SimpleITK/SimpleITK#1366), so feel free to ignore this PR if upstream SimpleITK will be pulled in anyway.
With this update, the ITK compilation completes. Note that I could not fully complete the SimpleElastix compilation until I also checked out the latest branch here,
update-simpleitk
, which I built on commit 175864a , to avoid an Elastix build error.I also had to use the official Cmake (tested on the latest version, v3.20.0) rather than MSVC Cmake (tested on v3.19.20122902-MSVC_2) to avoid an error when configuring Eigen3, which may be related to these issues:
InsightSoftwareConsortium/ITK#1888
ANTsX/ANTsR#275