# Build failure windows

**URL:** <https://discourse.slicer.org/t/build-failure-windows/7322>\
**Category:** Development\
**Created:** [June 26, 2019, 6:36pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322 "2019-06-26T18:36:31Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 1, 2019, 5:58pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/21 "2019-07-01T17:58:29Z")

</div>

> This PR should allow to build using VS2017. See [Problems with SUVComputation · Issue #1163 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/pull/1163)

Following [r28352](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=28352) , PR 1163 has been integrated.

> [@jamesobutler](#):
>
> The v142 toolset is binary compatible with v141 and v140. [C++ Binary Compatibility and Pain-Free Upgrades to Visual Studio 2019 - C++ Team Blog](https://devblogs.microsoft.com/cppblog/cpp-binary-compatibility-and-pain-free-upgrades-to-visual-studio-2019/)

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](https://github.com/Slicer/Slicer/pull/1164) and [Transform Function not working · Issue #1165 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/pull/1165)

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

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 2, 2019, 2:53am UTC](https://discourse.slicer.org/t/build-failure-windows/7322/22 "2019-07-02T02:53:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 2, 2019, 2:09pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/23 "2019-07-02T14:09:38Z")

</div>

> [@jcfr](#):
>
> After locally integrating these changes, could you check that the build works well for you ?

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](https://discourse.slicer.org/t/use-full-power-of-python-in-slicer/7162/5)).
- 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.

---

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [July 2, 2019, 6:10pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/24 "2019-07-02T18:10:02Z")

</div>

This is excellent. Thanks!!

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 2, 2019, 9:18pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/25 "2019-07-02T21:18:33Z")

</div>

> [@lassoan](#):
>
> I’ve tested latest Slicer master branch build using VS2017 and VS2019:

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

> [@lassoan](#):
>
> 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.

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 ?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 2, 2019, 10:55pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/26 "2019-07-02T22:55:12Z")

</div>

> [@jcfr](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 3, 2019, 6:35pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/27 "2019-07-03T18:35:23Z")

</div>

When installing VS2019, did you install the following components:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/7/f7ce2766e225e2b24b5eb9c6620a8a74da899778.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 3, 2019, 7:12pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/28 "2019-07-03T19:12:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 3, 2019, 7:39pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/29 "2019-07-03T19:39:58Z")

</div>

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](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:

> **[IRSL: Update redist directory for VS 2019 update 1 (!3233) · Merge Requests ·...](https://gitlab.kitware.com/cmake/cmake/merge_requests/3233)**
>
> VS 2019 Update 1 will fix its redist directories to be named \`VC142\` instead of \`VC141\`. It will also use cl \`19.21\` instead of \`19.20\` so we can use that...

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 3, 2019, 7:46pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/30 "2019-07-03T19:46:52Z")

</div>

> It appears that another developer has had a similar issue. See this thread on visual studio’s forum  
> [Developer Community](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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/9/d92d85eb0edb4c75e2b4360a2fa3ef1964388848.png)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 3, 2019, 10:12pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/31 "2019-07-03T22:12:03Z")

</div>

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

Using this [example](https://developercommunity.visualstudio.com/content/problem/618084/cmake-installrequiredsystemlibraries-broken-in-lat.html), I was not able to reproduce the problem using CMake 3.14.3 installed from [https://cmake.org/download/](https://cmake.org/download/)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 3, 2019, 10:47pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/32 "2019-07-03T22:47:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 4, 2019, 1:24pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/33 "2019-07-04T13:24:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 16, 2019, 9:58pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/34 "2019-07-16T21:58:44Z")

</div>

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](https://gitlab.kitware.com/cmake/cmake/issues/19488) detailing the issue.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 23, 2019, 1:00pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/35 "2019-07-23T13:00:47Z")

</div>

I issued a [merge request](https://gitlab.kitware.com/cmake/cmake/merge_requests/3585) 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.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 28, 2019, 8:32pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/36 "2019-07-28T20:32:01Z")

</div>

CMake 3.15.1 was released with that fix.

> **[CMake 3.15.1 available for download - Kitware Blog](https://blog.kitware.com/cmake-3-15-1-available-for-download/)**
>
> We are pleased to announce that CMake 3.15.1 is now available for download. Please use the latest release from our download page: https://cmake.org/download/ Thanks for ... Read More

@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/](https://blog.qt.io/blog/2019/06/17/qt-5-12-4-released-support-openssl-1-1-1/)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 28, 2019, 9:26pm UTC](https://discourse.slicer.org/t/build-failure-windows/7322/37 "2019-07-28T21:26:31Z")

</div>

@jamesobutler Thanks for the note 👍

> 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](https://github.com/Slicer/DashboardScripts/commit/f18c14da834634298aece29208fc0d0fdd529e86)
- docker image used for linux build is also being [regenerated](https://github.com/dockbuild/dockbuild/pull/61) 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:

- Install Qt 5.12.4 on windows build machine (overload)
- Update [qt-installer-noninteractive.qs](https://github.com/Slicer/SlicerBuildEnvironment/blob/master/Docker/qt5-centos7/qt-installer-noninteractive.qs#L43) in `qt5-centos7` docker image to use Qt 5.12.4
- To allow building Qt on macOS, create branch `5.12.4` based of [5.11.2](https://github.com/jcfr/qt-easy-build/tree/5.11.2) in [GitHub - jcfr/qt-easy-build: Scripts allowing to easily build Qt with OpenSSL support on Linux, macOS or Windows](https://github.com/jcfr/qt-easy-build), then build Qt on factory-south-macos and update dashboard scripts

[Previous page](https://discourse.slicer.org/t/build-failure-windows/7322.md?page=1)
