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
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 »

Un-checking USE_SUPERBUILD seems to be the key.
ngCMake.PNG
ngCMake.PNG (141.3 KiB) Viewed 1874 times
After this I'm able to set the paths to the LibPack(also see the un-grouped entries). It also seems that netgen is using the occ strategy of using a directory structure to distinguish debug vs release builds, not file name. This is a PITA, but I think both wmayer and peterl94 have provided workarounds for this with occ, maybe we can use them for netgen as well?

When building the nglib project I get this

Code: Select all

1>------ Build started: Project: nglib, Configuration: Release x64 ------
1>nglib.cpp
1>c:\users\chris\github\netgen\libsrc\occ\occgeom.hpp(275): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'overloaded-function' (or there is no acceptable conversion)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\ostream(508): note: could be 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(std::basic_streambuf<char,std::char_traits<char>> *)'
Maybe an OCC 7.3 porting issue?
"fight the good fight"
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 »

sgrogan wrote: Mon Apr 01, 2019 11:06 pm When building the nglib project I get this

Code: Select all

1>------ Build started: Project: nglib, Configuration: Release x64 ------
1>nglib.cpp
1>c:\users\chris\github\netgen\libsrc\occ\occgeom.hpp(275): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'overloaded-function' (or there is no acceptable conversion)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\ostream(508): note: could be 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(std::basic_streambuf<char,std::char_traits<char>> *)'
Maybe an OCC 7.3 porting issue?
I had the same error, for me it was resolved by replacing "endl" with "std::endl"...
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: nearly done.... FEM can be compiled and run in debug mode....
The release version i am working on. Then i will update the libpacks again....
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 »

FEM is now running..... :o :o :o
Capture3.PNG
Capture3.PNG (8.93 KiB) Viewed 1844 times
I was able to build netgen with opencascade from the the libpack, for the debug libs and release libs, see the dependey walker
Capture.PNG
Capture.PNG (21.11 KiB) Viewed 1844 times
Capture^2.PNG
Capture^2.PNG (20.63 KiB) Viewed 1844 times
Next step is to remove all absolute paths in the cmake files....
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: Tue Apr 02, 2019 2:51 pm Updated the libpack (https://github.com/apeltauer/FreeCAD/re ... bPack_12.1)
Thanks!
What Version of CMake are you using? I have a version.h problem in dxf.cpp I don't think it's related to your libpack, but rather to my new CMake(3.14.1)
With this version of your libpack and my new cmake my previous problems finding boost are gone, but now cmake can't find matplotlib, I'm tracking this down.

How did you handle numpy? I want to test a pip installed scipy to ensure compatibility.

Would you consider adding git-python? It's not a hard dependency, but it adds functionality to the addons-manager. I can handle this at packaging if your not interested. pyyaml, same thing except it's only used by some addon wb's.

How do you run FreeCAD after compilation? from VS? I need to move some files around to use "copy the contents of the bin directory of the libpack to the bin directory of the build directory".

I also have some NetgenPlugin errors that should be fixed by your pull request. I'll fetch your code and test this if it isn't merged into master first.

Awesome work, I don't know how to say thanks enough. :D
"fight the good fight"
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

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

Post by wmayer »

How do you run FreeCAD after compilation? from VS? I need to move some files around to use "copy the contents of the bin directory of the libpack to the bin directory of the build directory".
On my system I have several libpacks built for different compiler versions. In order to save some disk memory I don't copy the dlls into the bin directory but use a .bat file to start FreeCAD.

A typical .bat file looks like this:
set PATH=PATH_TO_THE_LIBPACK\bin;%PATH%
start FreeCAD.exe --write-log %1 %2 %3
I stopped using Visual Studio some years ago and switched to QtCreator as IDE but IIRC you can also define a .bat file as program in Visual Studio.
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 »

sgrogan wrote: Wed Apr 03, 2019 10:25 pm
What Version of CMake are you using? I have a version.h problem in dxf.cpp I don't think it's related to your libpack, but rather to my new CMake(3.14.1)
With this version of your libpack and my new cmake my previous problems finding boost are gone, but now cmake can't find matplotlib, I'm tracking this down.
At the moment I am using cmake version 3.14.0.
sgrogan wrote: Wed Apr 03, 2019 10:25 pm How did you handle numpy? I want to test a pip installed scipy to ensure compatibility.
Right now Numpy is only working with the Python.exe (release version). I have not figured out how to get the debug version for python_d.exe. I searched the internet, but just found out that Numpy has some problems to have the release and the debug version parallel installed....
sgrogan wrote: Wed Apr 03, 2019 10:25 pm Would you consider adding git-python? It's not a hard dependency, but it adds functionality to the addons-manager. I can handle this at packaging if your not interested. pyyaml, same thing except it's only used by some addon wb's.
No problem, I am adding git-python and pyyaml. Any other python libs??
sgrogan wrote: Wed Apr 03, 2019 10:25 pm How do you run FreeCAD after compilation? from VS? I need to move some files around to use "copy the contents of the bin directory of the libpack to the bin directory of the build directory".
I copy the FreeCADLibs_12.1.2_x64_VC15_bin_debug.7z or FreeCADLibs_12.1.2_x64_VC15_bin_release.7z files next to my bin folder. But like Werner already mentioned you could also extend your path variable and then run FreeCAD. To debug FC i run it through vs debugger....

BTW: Since yesterday I am using Visual Studio 2019. VS 2015,2017 and 2019 share the same runtime, so we can use the libpack with all this versions.... But the compile time was not reduced. To bad that VS2013 was quite faster then 2017 and 2019... :(
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 »

Updated the libpack with the additional python libs.... (https://github.com/apeltauer/FreeCAD/re ... bPack_12.1)
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

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

Post by wmayer »

Many thanks! With the new libpack everything works now out-of-the-box.
Post Reply