[Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Having trouble installing or compiling FreeCAD? Get help here.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Mon May 08, 2017 10:32 pm

triplus wrote:Latest OCC/OCE should use algorithms that do this in parallel.
Thanks!

Then, if something is to be "improved" today, it is what issue #2750 indicates. Right?
User avatar
sgrogan
Posts: 5331
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Mon May 08, 2017 11:24 pm

abdullah wrote:Then, if something is to be "improved" today, it is what issue #2750 indicates. Right?
I think so.
The PPA is built with OCCT 7.1 w/tbb
Win x64 is built with OCCT 7.1 w/tbb(32 bit is coming)
OSX is built with OCCT 7.1 w/tbb
My understanding is that OCCT has their own multi-threading algorithms and will use tbb if available. My personal testing hasn't shown a case where tbb offers an improvement. I think triplus is our expert, as far as I know he's implemented all we have with the BOA stuff. vejmarie has implemented some multi-threading stuff for .step import, but I think it relies on open/gl and uses your gpu.
It would probably be nice if we could detect tbb support in the "About FreeCAD", although I think it's just about how OCCT was compiled now?
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Tue May 09, 2017 10:36 pm

Thanks.
sgrogan wrote: It would probably be nice if we could detect tbb support in the "About FreeCAD", although I think it's just about how OCCT was compiled now?
I guess that at compilation time it should be possible to ldd the detected OCCT library to see if libtbb is present. I do not know any specific macro or similar...
User avatar
sgrogan
Posts: 5331
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Tue May 09, 2017 10:40 pm

abdullah wrote: I guess that at compilation time it should be possible to ldd the detected OCCT library to see if libtbb is present. I do not know any specific macro or similar...
I was thinking Cmake.config but I don't know where to look. VTK might be good too. Where does this happen in the source?
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Wed May 10, 2017 10:18 pm

sgrogan wrote:I was thinking Cmake.config but I don't know where to look. VTK might be good too. Where does this happen in the source?
The content is inserted into dialog / copied to clipboard in:
src/Gui/Splashscreen.cpp

FC info comes from (I think you know a lot about this one):
src/Build/Version.h

I thing that what you are searching may be:

Code: Select all

    str << "Python version: " << PY_VERSION << endl;
    str << "Qt version: " << QT_VERSION_STR << endl;
    str << "Coin version: " << COIN_VERSION << endl;
#if defined(HAVE_OCC_VERSION)
    str << "OCC version: "
        << OCC_VERSION_MAJOR << "."
        << OCC_VERSION_MINOR << "."
        << OCC_VERSION_MAINTENANCE
#ifdef OCC_VERSION_DEVELOPMENT
        << "." OCC_VERSION_DEVELOPMENT
#endif
        << endl;
The thing is that I have not found something like OCC_TBB to say whether OCC TBB support was compiled in or not.

For detecting the TBB version of the system:
https://software.intel.com/en-us/node/506137
triplus
Posts: 8677
Joined: Mon Dec 12, 2011 4:45 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby triplus » Fri May 12, 2017 10:34 pm

abdullah wrote:Then, if something is to be "improved" today, it is what issue #2750 indicates. Right?
Yes. Although the scope of enabling this in all places in FreeCAD where boolean operations are used is likely too broad. As it was done for all methods in Part workbench maybe issue #2750 could be closed as resolved.
sgrogan wrote:My understanding is that OCCT has their own multi-threading algorithms and will use tbb if available.
Yes that is correct. At the beginning i remember TBB was needed but that changed later on. Therefore this is the current situation (OCE ATM provides additional OpenMP option):
Intel TBB, optional for several modules.
It is NOT mandatory for activating parallel algorithms in OCCT,
but can be more efficient for this task then built-in OCCT parallelization routines (OSD_Parallel).
https://forum.freecadweb.org/viewtopic. ... 80#p142368

As for what could be done in addition. If you would like to tackle something. In Part workbench from Python console it is possible to use multiple arguments and fuzzy tolerance value can be set for boolean operation. But as for the GUI commands there is for example a Part Cut feature. Currently it doesn't support setting fuzzy tolerance or to be used with multiple arguments. Look at Part BooleanFragments feature Tolerance property for reference. Here is one use case when setting the tolerance value can be used:

https://forum.freecadweb.org/viewtopic. ... 54#p146936

As for multiple arguments. Tool property would need to accept more shapes. And i guess when a compound is provided individual shapes to be provided as a list... In such operations multi threading could be observed after (the same as in the boolean benchmark test). Once that would be done there i guess is a lot of features in FreeCAD using boolean algorithms and the same could be done for them.
User avatar
sgrogan
Posts: 5331
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Fri May 19, 2017 8:44 pm

abdullah wrote: The thing is that I have not found something like OCC_TBB to say whether OCC TBB support was compiled in or not.
Can you check for:

Code: Select all

set (OpenCASCADE_WITH_TBB
in file OpenCASCADEConfig.cmake
You need the OCCT dev files from the PPA. This file is available at FreeCAD compile time.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Fri May 19, 2017 10:04 pm

sgrogan wrote:in file OpenCASCADEConfig.cmake
You need the OCCT dev files from the PPA. This file is available at FreeCAD compile time.
Not sure where that file should be.

Code: Select all

ls /usr/lib/cmake/opencascade/
OpenCASCADEApplicationFrameworkTargets.cmake          OpenCASCADEDataExchangeTargets-release.cmake       OpenCASCADEModelingAlgorithmsTargets.cmake          OpenCASCADEModelingDataTargets-release.cmake
OpenCASCADEApplicationFrameworkTargets-release.cmake  OpenCASCADEFoundationClassesTargets.cmake          OpenCASCADEModelingAlgorithmsTargets-release.cmake  OpenCASCADEVisualizationTargets.cmake
OpenCASCADEDataExchangeTargets.cmake                  OpenCASCADEFoundationClassesTargets-release.cmake  OpenCASCADEModelingDataTargets.cmake                OpenCASCADEVisualizationTargets-release.cmake
I have all dev packages installed:

Code: Select all

ii  libopencascade-data-exchange-7.1.0:amd64       7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology CAE platform shared library
ii  libopencascade-data-exchange-dev:amd64         7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology platform library development files
ii  libopencascade-foundation-7.1.0:amd64          7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology CAE platform shared library
ii  libopencascade-foundation-dev:amd64            7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology platform library development files
ii  libopencascade-modeling-algorithms-7.1.0:amd64 7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology CAE platform shared library
ii  libopencascade-modeling-algorithms-dev:amd64   7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology platform library development files
ii  libopencascade-modeling-data-7.1.0:amd64       7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology CAE platform shared library
ii  libopencascade-modeling-data-dev:amd64         7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology platform library development files
ii  libopencascade-ocaf-7.1.0:amd64                7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology CAE platform shared library
ii  libopencascade-ocaf-dev:amd64                  7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology platform library development files
ii  libopencascade-visualization-7.1.0:amd64       7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology CAE platform shared library
ii  libopencascade-visualization-dev:amd64         7.1.0-0ppa1~ubuntu16.04.1 amd64        Open CASCADE Technology platform library development files
The headers in the include directory include conditional compilation with HAVE_TBB macro. One of the cmake files should define this pre-processor with add_definitions(). However, I have grep all the cmake files above search for TBB and none is to be found... :(
User avatar
sgrogan
Posts: 5331
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Sat May 20, 2017 3:28 pm

abdullah wrote: The headers in the include directory include conditional compilation with HAVE_TBB macro. One of the cmake files should define this pre-processor with add_definitions(). However, I have grep all the cmake files above search for TBB and none is to be found... :(
Thanks for checking. It looks like we have a packaging bug. We are splitting the OCC package and the config file isn't specific to any of the sub-packages so we are not picking up the config file. I'm not sure where we should install it from, @NormandC do you have any thoughts?
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby NormandC » Sat May 20, 2017 6:17 pm

sgrogan wrote:We are splitting the OCC package and the config file isn't specific to any of the sub-packages so we are not picking up the config file. I'm not sure where we should install it from, @NormandC do you have any thoughts?
At the moment, none whatsoever...

Code: Select all

	-DUSE_TBB:BOOL=on \
is set under override_dh_auto_configure in https://git.launchpad.net/~freecad-main ... bian/rules, I would have thought it would be taken care of.

As OCCT's CMake implementation is completely different from OCE'S I have no point of reference.

Maybe gdo35 has some insight.