C1001: Internal compiler error

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

12:18:40:263 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]
12:18:40:263 13> (compiler file ‘msc1.cpp’, line 1589)
then
12:34:22:973 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.
12:34:22:985 13>Done building project VTK.vcxproj – FAILED.
Is there any way to overcome this problem?
1 Like

I’ve built Slicer on Windows thousands of times but I haven’t run into this issue.

Are you building the latest Slicer main branch?

What is the build toolset version?
Mine is 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.

2 Likes

I have disabled all modules referring to the IOSS and have successfully built the Slicer without any error
Thank you

2 Likes

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.

1 Like

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.

1 Like

Thank you ,I solved the problem after I changed the MSVC tool to version 14.34