Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Failed to build on Win10 #489

Open
MartinKjunior opened this issue Oct 14, 2022 · 3 comments
Open

Failed to build on Win10 #489

MartinKjunior opened this issue Oct 14, 2022 · 3 comments

Comments

@MartinKjunior
Copy link

MartinKjunior commented Oct 14, 2022

Hi all, I have installed CMake-gui (3.24.2), then I have followed the GettingStarted tutorial (git clone https://github.com/kaspermarstal/SimpleElastix), using Visual Studio 17 2022 generator (VS Community 2022 v17.3.6 installed and I used it to install Git for windows) and I unticked everything except for WRAP_PYTHON. Then I followed step 3 for Windows by opening x64 Native Tools CL, changed directory to my build directory, ran msbuild and everything got executed. At the very end of ~20min wait I saw the following (my username censored with ...):

Done Building Project "C:\Users...\buildITK\virtualenv.vcxproj" (default targets).

Done Building Project "C:\Users...\buildITK\Elastix.vcxproj" (default targets) -- FAILED.

Done Building Project "C:\Users...\buildITK\ALL_BUILD.vcxproj" (default targets) -- FAILED.

Build FAILED.

When I look into C:\Users...\buildITK\SimpleITK-build all I see is a CMakeCacheInit text file, no setup.py or anything. I have no clue where to go from now. Any ideas? I've tried compiling it twice, once only using the CL and the second time with CMake-gui + CL, but the result was the same in both cases (they were built into different build folders).

There were 2 Warnings:

"C:\Users...\buildITK\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users...\buildITK\Elastix.vcxproj" (default target) (3) ->
"C:\Users...\buildITK\ITK.vcxproj" (default target) (4) ->
(CustomBuild target) ->
C:\Users...\buildITK\ITK\Modules\ThirdParty\DICOMParser\src\DICOMParser\DICOMParser.cxx(830,14): warning C4834:
discarding return value of function with 'nodiscard' attribute [C:\Users...\buildITK\ITK-build\Modules\ThirdPart
y\DICOMParser\src\DICOMParser\ITKDICOMParser.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\IO\GE\src\itkGE5ImageIO.cxx(292,14): warning C4834: discarding return value of
function with 'nodiscard' attribute [C:\Users...\buildITK\ITK-build\Modules\IO\GE\src\ITKIOGE.vcxproj] [C:\Users
...\buildITK\ITK.vcxproj]

And there were 19 Errors:

"C:\Users...\buildITK\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users...\buildITK\Elastix.vcxproj" (default target) (3) ->
"C:\Users...\buildITK\ITK.vcxproj" (default target) (4) ->
(CustomBuild target) ->
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Users...\buildITK\ITK\Modules\ThirdParty\OpenJPEG\src\openjpeg\opj_includes.h(106,35): error C2169: 'lrintf'
: intrinsic function, cannot be defined [C:\Users...\buildITK\ITK-build\Modules\ThirdParty\OpenJPEG\src\openjpeg
itkopenjpeg.vcxproj] [C:\Users...\buildITK\ITK.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5):
error MSB8066: Custom build for 'C:\Users...\buildITK\CMakeFiles\1f8d42a7429c18dcf4485ed2164c15ff\ITK-mkdir.rule
;C:\Users...\buildITK\CMakeFiles\1f8d42a7429c18dcf4485ed2164c15ff\ITK-download.rule;C:\Users...\buildITK\CM
akeFiles\1f8d42a7429c18dcf4485ed2164c15ff\ITK-update.rule;C:\Users...\buildITK\CMakeFiles\1f8d42a7429c18dcf4485ed
2164c15ff\ITK-patch.rule;C:\Users...\buildITK\CMakeFiles\1f8d42a7429c18dcf4485ed2164c15ff\ITK-configure.rule;C:\U
sers...\buildITK\CMakeFiles\1f8d42a7429c18dcf4485ed2164c15ff\ITK-build.rule;C:\Users...\buildITK\CMakeFiles
\1f8d42a7429c18dcf4485ed2164c15ff\ITK-install.rule;C:\Users...\buildITK\CMakeFiles\35b536ee8ef2f4f922c853552fbfef
0e\ITK-complete.rule;C:\Users...\buildITK\CMakeFiles\9c0bcb5b7209f25949f341ccd432c295\ITK.rule;C:\Users...
SimpleElastix\SuperBuild\CMakeLists.txt' exited with code 1. [C:\Users...\buildITK\ITK.vcxproj]

@MartinKjunior
Copy link
Author

I've noticed something when I tried to build SimpleElastix using VS2022. One of the error messages said

9>LINK : fatal error LNK1181: cannot open input file 'C:\Users...\build\SimpleElastix\ITK-build\lib\Release\ITKIOJPEG2000-5.1.lib' [C:\Users...\build\SimpleElastix\SimpleITK-build\Wrapping\Python\SimpleITK_PYTHON.vcxproj]

The weird thing is that there is a file called ITKIOJPEG-5.1.lib, but not ITKIOJPEG2000-5.1.lib. I wonder if there is a mistake in the build or sth? After this the build ends with:

Done building project "SimpleITK.vcxproj" -- FAILED.

@RPGillespie6
Copy link

RPGillespie6 commented Nov 19, 2022

Seeing this exact issue as well. This repo hasn't changed since April though so it probably means one of its external dependencies is not pinned. My guess is that whichever one is pulling in "OpenJPEG" needs to be pinned to a known-working commit or tag.

Edit:

As a workaround, looks like the Debug or Minimal Size Release build configurations work. It's only the "Release" build configuration that is currently broken.

@MartinKjunior
Copy link
Author

Long time no reply: the solution suggested by RPGillespie6 works. However, the support for this project (SimpleElastix) seems to have been dropped and instead the current way to work with Elastix in python is using ITK-elastix package. Unfortunately, this package is built on ITK instead of SimpleITK, so working with it is a bit trickier, but the package works perfectly fine after installing through pip and you don't need to build the whole project, like is the case with SimpleElastix, saving hours.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants