For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Visual Studio 2019 Version 16.4.4 hangs when building OCC

Steve Lockley's picture

We are having problems building OCC 7.4, using C runtime 142 on Visual Studio 2019 16.4.4, 

In Release Win32 mode,  we can build Foundation.sln, ModelingData.sln, but when we try to build ModelingAlgorithms.sln the compiler gets to BRepExtrema_DistShapeShape.cxx and seems to be in an infinite loop.

The c++ compiler is locked on 29% CPU usage ad-infinitum.

Anyone else seen this, we can reproduce the problem on several machines and on our CI build

Just for clarity this is not specific to OCC  7.4 we have the same problem with OCC 7.3

The line that causes the hang is Line 136

std::stable_sort(aPairList.begin(), aPairList.end(), BRepExtrema_CheckPair_Comparator);

Comment this out or change to std::sort and it compiles, I am not knowledgable enough on this function to know we need stable_sort?

Steve Lockley's picture

Just for clarity this is not specific to 7.4 OCC we have the same problem with OCC 7.3

Steve Lockley's picture

I have reported this problem to Microsoft https://developercommunity.visualstudio.com/content/problem/934955/stdstable-sort-causes-the-compiler-to-hang.html it is clearly not an issue with OCC as the source compiles fine on previous versions of Visual Studio

Andreas Gottschling's picture

The point is closed at MS. Still the same problem with newest VS2019.

Any workaround known?

Kirill Gavrilov's picture

They have closed issue not because it is not reproducable, but because they have not recieved minimized reproducing sample (and they are too busy building external open source projects).
So that extracting sample code would help revealing bug report.

Chris Were's picture

This workaround is working now for me also, thankyou.  

Update: well it got further, now hung on:

...

24>   Creating library ..\..\..\win32\vc14\lib\TKSTEP.lib and object ..\..\..\win32\vc14\lib\TKSTEP.exp
24>TKSTEP.vcxproj -> C:\_SVN\OpenCascade\opencascade-7.4.0\adm\msvc\vc142\.\..\..\..\win32\vc14\bin\TKSTEP.dll

Steve Lockley's picture

There is a workaround but I don't know how safe it is. 

if you change a couple of instances where this is in the code 

std::stable_sort(aPairList.begin(), aPairList.end(), BRepExtrema_CheckPair_Comparator);

to use std::sort, as in my original mail, then it will compile , can someone advise if stable_sort is essential 

Steve Lockley's picture

You can also downgrade the Platform Toolset to v141 and this fixes it

Kirill Gavrilov's picture

If I understanda correctly, the problem affects only 32-bit builds, and not 64-bit builds, which indicates that Microsoft abondance 32-bit support in their building toolchains.
Why using 32-bit targets in '2020 anyway?

Steve Lockley's picture

Its possible, I suspect if I had time to make a small enough test case for them, they would have found the problem, but it seems it is not a simple problem, it relates to the state of the compiler as some stable_sorts work.

We use 32 bit for 2 reasons, compatibility with other tool chains and memory use on large problems

Chris Were's picture

A similar issue.  MSVC 2019 toolset 142 32 bit hangs for me building TKTopAlgo:

...

8>BRepApprox_TheComputeLineBezierOfApprox_0.cxx
8>BRepApprox_TheComputeLineOfApprox_0.cxx
8>BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox_0.cxx
8>BRepApprox_TheImpPrmSvSurfacesOfApprox_0.cxx
8>BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox_0.cxx
8>BRepApprox_TheMultiLineOfApprox_0.cxx
8>BRepApprox_ThePrmPrmSvSurfacesOfApprox_0.cxx
8>BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox_0.cxx

Been sitting on this for a couple of hours now.  will leave it a couple more but I'm not hopeful much will happen!  

yes builds OK in x64.  We need 32bit support for our customer base, still a few out there...

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.