I tried to build the latest Slicer on Windows using CMake 3.26.3 and Visual Studio 2022 17.6.1 with the prerequisites have met (Windows — 3D Slicer documentation)
CMake configure and generate the Release build were done without any error
However, during the Release by Visual Studio there was an error
||13>E:\S\B\VTK\ThirdParty\ioss\vtkioss\private_copy_fmt\fmt/ostream.h(32,1): fatal error C1001: Internal compiler error. [E:\S\B\VTK-build\ThirdParty\ioss\vtkioss\ioss.vcxproj]
||13> (compiler file ‘msc1.cpp’, line 1589)
||13>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build for ‘E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-mkdir.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-download.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-update.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-patch.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-configure.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-build.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-create_egg_info.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-generate_project_description.rule;E:\S\B\CMakeFiles\2f3b8b1f079799e3ffdef766991c1db2\VTK-install.rule;E:\S\B\CMakeFiles\37951788506b17b75cca77d1d45f0dfb\VTK-complete.rule;E:\S\B\CMakeFiles\9e8337cb89344f33c6ac88b23a164fd9\VTK.rule;E:\S\S\CMakeLists.txt’ exited with code 1.
||13>Done building project VTK.vcxproj – FAILED.
|Is there any way to overcome this problem?
I’ve built Slicer on Windows thousands of times but I haven’t run into this issue.
Are you building the latest Slicer
What is the build toolset version?
14.34.31933, as in the top-level CMakeCache.txt I have a line like this:
CMAKE_AR:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/lib.exe
Thank for the quick response
I used the git for the Slicer according to the guide Windows — 3D Slicer documentation which is GitHub - Slicer/Slicer: Multi-platform, free open source software for visualization and image computing.
The toolset I used is C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/lib.exe
New compiler versions often need some time to get stable, so it is usually better not to use the very latest version. You can downgrade to toolset version 14.34, by opening the Visual Studio Installer application, choose Modify, choose “Individual components” tab, and unselect MSVC… build tools (Latest)" and select a 14.34 instead.
You can also open VTK build settings in CMake and disable all modules that refer to IOSS.
@jcfr It seems that this problematic private copy of the
fmt library has been removed in VTK-9.2.0 (in September 2022). Could we rebase Slicer’s VTK on a recent VTK version? The amount of backported fixes (and the lots more fixes that we have not backported) is becoming a bit worrying.
I have disabled all modules referring to the IOSS and have successfully built the Slicer without any error
We got another report at faild to install the debug and release version of slicer multipy times · Issue #6990 · Slicer/Slicer · GitHub
@jcfr we’ll probably get just more and more reports like this (unless Microsoft very quickly releases a new compiler revision). To avoid frustrating many developers, could we upgrade Slicer’s VTK? Recent VTK versions don’t contain the file that crashes the MSVC compiler.
Could we rebase Slicer’s VTK on a recent VTK version?
Indeed, a pull-request is being worked on.
Can you tell me how to disable all modules referring to the IOSS?
I met the same problems during rebuilding.
I would recommend to not mess with the configuration but instead update to the latest Slicer main version.
Thank you ,I solved the problem after I changed the MSVC tool to version 14.34