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

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
apeltauer
Posts: 359
Joined: Fri Aug 11, 2017 2:19 pm

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

Post by apeltauer » Mon Mar 11, 2019 9:50 am

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
Site Admin
Posts: 16862
Joined: Thu Feb 19, 2009 10:32 am

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

Post by wmayer » Mon Mar 11, 2019 11:22 am

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: 359
Joined: Fri Aug 11, 2017 2:19 pm

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

Post by apeltauer » Mon Mar 11, 2019 1:19 pm

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: 359
Joined: Fri Aug 11, 2017 2:19 pm

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

Post by apeltauer » Wed Mar 13, 2019 3:31 am

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
Site Admin
Posts: 16862
Joined: Thu Feb 19, 2009 10:32 am

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

Post by wmayer » Wed Mar 13, 2019 8:35 am

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: 359
Joined: Fri Aug 11, 2017 2:19 pm

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

Post by apeltauer » Mon Mar 18, 2019 4:28 pm

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
Posts: 6215
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan » Mon Mar 18, 2019 8:41 pm

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
Site Admin
Posts: 16862
Joined: Thu Feb 19, 2009 10:32 am

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

Post by wmayer » Tue Mar 19, 2019 9:05 am

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: 359
Joined: Fri Aug 11, 2017 2:19 pm

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

Post by apeltauer » Tue Mar 19, 2019 1:30 pm

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 554 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: 359
Joined: Fri Aug 11, 2017 2:19 pm

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

Post by apeltauer » Tue Mar 19, 2019 1:54 pm

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