Build failure windows

If we can build Slicer with VS2017 without losing Python binary compatibility then we should switch to VS2017 because then we could upgrade to latest Qt (which contains a couple of useful improvements and fixes).

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

Could someone test this is effectively the case ?

After confirming it builds, we may also have to revisit which runtime libraries are packages. Indeed, the package will then have dependency on both VS2015 and VS2017 runtime libraries.

See https://github.com/Slicer/Slicer/blob/7f08682494af41c7941b62cbcd37a91feffe148b/CMake/SlicerCPack.cmake#L158-L159 and InstallRequiredSystemLibraries

Could Slicer build with VS2019 as well?

The v142 toolset is binary compatible with v141 and v140. https://devblogs.microsoft.com/cppblog/cpp-binary-compatibility-and-pain-free-upgrades-to-visual-studio-2019/

Well, my first test was a bust. I am not a regular python user, so that is surely why.

I tried “pip install pandas” from the command line:

>>> pip install pandas
  File "<console>", line 1
    pip install pandas
              ^
SyntaxError: invalid syntax

After some web search, I understood the following is the way to install using pip:

c:\S\python-install\bin>PythonSlicer -m pip install pandas
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pandas
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pandas/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pandas/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pandas/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pandas/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pandas/
  Could not fetch URL https://pypi.org/simple/pandas/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pandas/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
  Could not find a version that satisfies the requirement pandas (from versions: )
No matching distribution found for pandas
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping

Clearly I misunderstood the procedure, and I will keep looking. If it’s obvious to y’all, any hints are welcome!

Do you think it is because I set Slicer_USE_PYTHONQT_WITH_OPENSSL as unchecked?

Yes, configuring python without OpenSSL is why the https url did not work.

From the console you can do slicer.util.pip_install("pandas").

This PR should allow to build using VS2017. See Problems with SUVComputation · Issue #1163 · Slicer/Slicer · GitHub

Following r28352 , PR 1163 has been integrated.

This is great.

This PRs should allow to build with VS2017 and VS2019. See Runtime Error! Crashes when using Editor · Issue #1164 · Slicer/Slicer · GitHub and Transform Function not working · Issue #1165 · Slicer/Slicer · GitHub

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
Developer Community

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