Building Libs for Windows Debug Version with VS2017/Qt5.12

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Problem solved:
Swig version 3.0.12 is too old for python 3.7 :)
Found this discussion (https://stackoverflow.com/questions/530 ... xcess-args)
After modifying pyrun.swg, the code is running and i can access coin3d via pivy.

Next step, check if all tests are running....
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

Good news!
Once you finished the stuff can you report which modifications you had to make in the source code, please?
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Modification in SWIG:
Lib\python\pyrun.swg, methode:

Code: Select all

SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
line1365 looks now like this...

Code: Select all

#if PY_VERSION_HEX >= 0x03000000
    PyObject *empty_args = PyTuple_New(0);
    if(empty_args){
      inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, empty_args, Py_None);
      if (inst) {
        PyObject_SetAttr(inst, SWIG_This(), swig_this);
        Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
      }
    }
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Short update:
My Libpack for debug is almost done. Compiling Fc works, the Test in the debug version works almost too. Except a crash at the end. Will figure this out.
Now I need to create a new cmake Libpack file to find all dependencies.
At this time I had no luck to get Fem running. Compiling Netgen was no problem. But building Smesh is a little harder with all the dependencies needed....
BR Manuel
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

Except a crash at the end. Will figure this out.
Could be the area module when using boost.python. If using this option you have to make sure to link against the debug Python library which is a bit tricky.
But building Smesh is a little harder with all the dependencies needed....
On github there is also an smesh version available which doesn't require all the med and hdf5 stuff. I recommend using this one because it's much easier to build.
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Update:
The debug build works. The cmake Adaption and a new Libpack.cmake file just works good.
The debug build still fails at two points.
1. Numpy is a little hard to get for the debug version
2. Still crashes after the test finish with no error in the arch tests. (Boost python is linked against pyhton_d)
3. I had no time to check the smesh stuff again.

Release version can be build now. Some depencies are still not working, figure that out tomorrow.

After that I would like to upload my Libpack. Does someone wants to give it a try?
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

apeltauer wrote: Mon Mar 18, 2019 4:28 pm After that I would like to upload my Libpack. Does someone wants to give it a try?
I'm very interested in both debug and release versions.
"fight the good fight"
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

After that I would like to upload my Libpack. Does someone wants to give it a try?
And please add the .pdb files into the Libpack directory as otherwise the debug versions are of limited help.
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Update:
Release build works just fine. Tests are good except of one in the ship workbench. see pic:
Capture.PNG
Capture.PNG (49.54 KiB) Viewed 1451 times
Also the web stuff does not work yet. In qt5 the webkit is depricated for the webenging. I tried to merge the PR (https://github.com/FreeCAD/FreeCAD/pull/1937) from mumme74. But it throws an exception.
For now their is no start page...
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Here is my first draft of the new lipack:

Cmake changes can be found here:
https://github.com/apeltauer/FreeCAD/tr ... ack_12.1.1

The libpack and the pdbs can be found here:
https://github.com/apeltauer/FreeCAD/releases

I hope someone can test the libpack and can tell me if it works...
After a positive feedback i can create PR to the FC main branch...
Br Manuel
Post Reply