[WIP] updating to netgen 6.2.2004 (was smesh windows problem)

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
User avatar
sgrogan
Posts: 5977
Joined: Wed Oct 22, 2014 5:02 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby sgrogan » Sun May 17, 2020 1:36 pm

sgrogan wrote:
Sun May 17, 2020 12:23 pm
Anyway I will try to re-build FreeCAD release with debug symbols using the updated environment and see if we can get a better error message.
Picking up on this https://forum.freecadweb.org/viewtopic. ... 31#p399498
libmesh.dll does not exist in the Conda env.
I have a release build running locally with PDB and without SEH. So hopefully FreeCAD will crash and we will get a good error message.
With the stock build Standard, Mefisto, and gmesh meshes work from Mesh WB, only netgen fails with the access violation on a Part cube.

EDIT:@UR_ is ahead of me.

EDIT2: MeshPart.pyd
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby looo » Sun May 17, 2020 1:49 pm

UR_ wrote:
Sun May 17, 2020 1:35 pm

No more insights without debug build of smesh and netgen :?

Perhaps netgen should be pinned to 6.2.1808 until this is fixed, to get at least working builds.
Thanks! I will try to provide debug builds for netgen and smesh in the next days.

Regarding pinning of 6.2.1808: let's try to solve the issue first. Actually pulling such incompatible versions should never happen. We need to pin things more tightly...
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby looo » Mon May 18, 2020 8:44 am

There is now a netgen build in debug mode available from freecad/label/debug. To install try the following:

Code: Select all

conda install netgen -c freecad/label/debug
I simple added 500 to the build-number to ensure the debug build is installed if freecad/label/debug is added to the channels. I think this is something we can also apply to other feedstocks to make debug builds easily reproducible:
https://github.com/looooo/netgen-feedst ... ddf82dc701

For windows I simple did the following to create the debug build:

Code: Select all

cd <path to netgen feedstock>
set FEATURE_DEBUG=1
conda build . -m .ci_support\win<...>.yaml
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby looo » Mon May 18, 2020 4:16 pm

debug packages for netgen, smesh (linux and win) are uploaded. Not yet sure if the linux builds are really debug-builds as the size hasn't changed. You can try if updating to debug-packages works by:

Code: Select all

conda update --all -c freecad/label/debug
Reverting to non-debug builds worked for me by simple updating and not adding the debug channel:

Code: Select all

conda update --all
User avatar
sgrogan
Posts: 5977
Joined: Wed Oct 22, 2014 5:02 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby sgrogan » Mon May 18, 2020 7:52 pm

looo wrote:
Mon May 18, 2020 4:16 pm
debug packages for netgen, smesh (linux and win) are uploaded. Not yet sure if the linux builds are really debug-builds as the size hasn't changed. You can try if updating to debug-packages works by:

Code: Select all

conda update --all -c freecad/label/debug
When running CMake in the env I get some medc errors

Code: Select all

Check for medfile (libmed and libmedc) ...
CMake Error at cMake/FindMEDFile.cmake:46 (MESSAGE):
  med.h not found, please install development header-files for libmedc
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:65 (find_package)
  CMakeLists.txt:52 (SetupSalomeSMESH)
I thought medc was disabled for external(Conda) smesh?
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby looo » Tue May 19, 2020 8:41 am

sgrogan wrote:
Mon May 18, 2020 7:52 pm
I thought medc was disabled for external(Conda) smesh?
We explicitly set it to off in the smesh-feedstock:
https://github.com/conda-forge/smesh-fe ... ild.sh#L18

I wonder how to create a proper call stack like UR_ posted. When I try meshing with freecad on windows (using debug packages of netgen and smesh) I only get this error message:

Code: Select all

The error message is: c:\users\lo\miniconda3\conda-bld\netgen_1589790409431\work\libsrc\core\array.hpp:519	: index 1 out of range [0,0)
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby looo » Tue May 19, 2020 3:42 pm

Are debug/release builds interchangeable? Is it possible to use a debug netgen and a release smesh, freecad? And if so, do I have to recompile freecad if I build netgen in debug-mode. Somhow I get different errors, trying different combinations.

Maybe it's better to use RelWithDebInfo.
clackner
Posts: 1
Joined: Mon May 18, 2020 9:40 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby clackner » Tue May 19, 2020 5:35 pm

Hi,
looo wrote:
Tue May 19, 2020 8:41 am
I wonder how to create a proper call stack like UR_ posted. When I try meshing with freecad on windows (using debug packages of netgen and smesh) I only get this error message:

Code: Select all

The error message is: c:\users\lo\miniconda3\conda-bld\netgen_1589790409431\work\libsrc\core\array.hpp:519	: index 1 out of range [0,0)
Netgen does range checks only in debug build, so you get this exception here instead of the crash in release mode. It seems like some array is not properly created and then used. A stack trace here would be nice if possible.
I'll try to set this up on windows myself as well.
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby looo » Wed May 20, 2020 1:10 pm

clackner wrote:
Tue May 19, 2020 5:35 pm
Netgen does range checks only in debug build, so you get this exception here instead of the crash in release mode. It seems like some array is not properly created and then used. A stack trace here would be nice if possible.
I'll try to set this up on windows myself as well.
One additional thing I changed on windows between version 6.2.1808 and 6.2.2004 is this options:
`-D USE_NATIVE_ARCH:BOOL=OFF ^`. Somehow azure was failing when this was enabled for 6.2.2004. But I am not sure if this has influence as it is disabled for linux too.

Btw.: great to have you on board of the freecad-community!
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: [WIP] updating to netgen 6.2.2004 (was smesh windows problem)

Postby looo » Thu May 21, 2020 10:02 am

just in case anyone else is running into this when trying to build freecad in debug mode:

I run into this error:

Code: Select all

QuantityPyImp.cpp.obj : error LNK2001: Nicht aufgel□stes externes Symbol "__imp__Py_NegativeRefcount".
Not resolved external symbol __imp__Py_NegativeRefcount

Regarding

Code: Select all

stackoverflow
Py_DEBUG is defined somewhere. Indeed there is a file include/pyconfig.h in the environment which defines Py_DEBUG:

Code: Select all

#ifdef _DEBUG
#       define Py_DEBUG
#endif
Commenting this line makes it possible for me to compile freecad in debug-mode. Let's see if I can provide some more information about the netgen problem.