Build failure windows

This PR should allow to build using VS2017. See https://github.com/Slicer/Slicer/pull/1163

Following r28352 , PR 1163 has been integrated.

This is great.

This PRs should allow to build with VS2017 and VS2019. See https://github.com/Slicer/Slicer/pull/1164 and https://github.com/Slicer/Slicer/pull/1165

After locally integrating these changes, could you check that the build works well for you ?

Yes I will check this upcoming week :+1: . Currently on vacation for the Fourth of July this week.

I’ve tested latest Slicer master branch build using VS2017 and VS2019:

  • Slicer build and self-tests were successful (the same tests fail as in the nightly with VS2015)
  • Installation of scipy, matplotlib, and wxPython was successful (pip_install script did , and everything seemed to work fine (tested the plotting features with scripts here).
  • Packaging succeeded.

There is just one set of warnings on VS2017 that might cause issues on systems that don’t have VS2017 runtime libraries installed: “CMake Warning at C:/Program Files/CMake/share/cmake-3.14/Modules/InstallRequiredSystemLibraries.cmake:558 (message): system runtime library file does not exist: ‘MSVC_REDIST_DIR-NOTFOUND/x64/Microsoft.VC141.CRT/msvcp140.dll’” - but this seems to be a CMake issue and we can address it if we switch to VS2017 or VS2019 for the official builds.

2 Likes

This is excellent. Thanks!!

This is great. Thanks for taking the time to do so.

While which version of CMake does this happen ? Which option did you select for the generator and toolset ? And is the warning report during configuration or during package creation ?

I’ve used CMake-3.14.3.

CMake generator options for VS2017: -G “Visual Studio 16 2019” -A x64 -T v141
CMake generator options for VS2019: -G “Visual Studio 16 2019” -A x64 -T v142

The error occurred during configuration. There was no warning or error during package generation.

When installing VS2019, did you install the following components:

image

Yes, I installed these - without that CMake did not find the compiler and could not even start configuring the project.

It appears that another developer has had a similar issue. See this thread on visual studio’s forum:
https://developercommunity.visualstudio.com/content/problem/618084/cmake-installrequiredsystemlibraries-broken-in-lat.html

Also a potential cmake related change, not sure which 3.14.X version this was included in:

It appears that another developer has had a similar issue. See this thread on visual studio’s forum
https://developercommunity.visualstudio.com/content/problem/618084/cmake-installrequiredsystemlibraries-broken-in-lat.html

This is great as it will allow to easily reproduce and move forward. Stay tuned for an update.

Also a potential cmake related change, not sure which 3.14.X version this was included in:

Thanks for pointing this out but it is already part of the CMake 3.14.3 release.

image

@lassoan Are you using the version of CMake provided by Visual Studio or one you installed yourself ?

Using this example, I was not able to reproduce the problem using CMake 3.14.3 installed from https://cmake.org/download/

I installed it myself. I’ll start a clean build and see if it comes up again.

I did a new build from scratch using VS2017 toolset (with VS2019 IDE) and the CMake warnings are the same.

Warnings
  CMake Warning at C:/Program Files/CMake/share/cmake-3.14/Modules/InstallRequiredSystemLibraries.cmake:558 (message):
    system runtime library file does not exist:
    'MSVC_REDIST_DIR-NOTFOUND/x64/Microsoft.VC141.CRT/msvcp140.dll'
  Call Stack (most recent call first):
    CMake/SlicerCPack.cmake:159 (include)
    CMake/LastConfigureStep/CMakeLists.txt:44 (include)
  
  CMake Warning at C:/Program Files/CMake/share/cmake-3.14/Modules/InstallRequiredSystemLibraries.cmake:558 (message):
    system runtime library file does not exist:
    'MSVC_REDIST_DIR-NOTFOUND/x64/Microsoft.VC141.CRT/vcruntime140.dll'
  Call Stack (most recent call first):
    CMake/SlicerCPack.cmake:159 (include)
    CMake/LastConfigureStep/CMakeLists.txt:44 (include)
  
  CMake Warning at C:/Program Files/CMake/share/cmake-3.14/Modules/InstallRequiredSystemLibraries.cmake:558 (message):
    system runtime library file does not exist:
    'MSVC_REDIST_DIR-NOTFOUND/x64/Microsoft.VC141.CRT/concrt140.dll'
  Call Stack (most recent call first):
    CMake/SlicerCPack.cmake:159 (include)
    CMake/LastConfigureStep/CMakeLists.txt:44 (include)
  
  CMake Warning at C:/Program Files/CMake/share/cmake-3.14/Modules/InstallRequiredSystemLibraries.cmake:558 (message):
    system runtime library file does not exist:
    'MSVC_REDIST_DIR-NOTFOUND/x64/Microsoft.VC141.OPENMP/vcomp140.dll'
  Call Stack (most recent call first):
    CMake/SlicerCPack.cmake:159 (include)
    CMake/LastConfigureStep/CMakeLists.txt:44 (include)

Slicer inner-build CMakeCache.txt contains MSVC_REDIST_DIR:PATH=MSVC_REDIST_DIR-NOTFOUND.

The files that are not found are available at “c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.CRT”.

MSVC_REDIST_DIR is correctly found for VS2015 and VS2019 toolsets:

  • MSVC_REDIST_DIR:PATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Redist/MSVC/14.21.27702
  • MSVC_REDIST_DIR:PATH=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/redist

As far as I remember, I only installed (and updated) Visual Studio Community edition using the default installer. I don’t know why there are files in both “Microsoft Visual Studio” and “Microsoft Visual Studio 14.0” subfolders.

I have never had VS 2017 IDE installed on my system (it’s new) and still had the CMake warnings when using VS2019 generator and VS2017 toolset.

I posted https://gitlab.kitware.com/cmake/cmake/issues/19488 detailing the issue.

2 Likes

I issued a merge request in CMake for the MSVC_REDIST_DIR-NOTFOUND issue. It has been merged and will be included in the CMake 3.15.1 release which will probably come out in 2 weeks or so.

So one less issue towards building Slicer with a newer visual studio toolset.

2 Likes

CMake 3.15.1 was released with that fix.

@jcfr @lassoan Is there anything else preventing the change for the Windows Slicer nightly build being built with a newer toolset(v142 or at least v141) and updating to use the latest Qt LTS version (5.12.4)? https://blog.qt.io/blog/2019/06/17/qt-5-12-4-released-support-openssl-1-1-1/

@jamesobutler Thanks for the note :+1:

CMake 3.15.1 was released with that fix.

  • Newer CMake version has been installed on windows and macos build machines, then corresponding dashboard scripts have been updated
  • docker image used for linux build is also being regenerated to include newer CMake

Is there anything else preventing the change for the Windows Slicer nightly build being built with a newer toolset(v142 or at least v141) and updating to use the latest Qt LTS version (5.12.4)?

It is a matter of taking the time to install the binaries on windows and update the dashboard script. for sake of consistency, I suggest we update the Qt version on all platforms.

Todo:

1 Like