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

Having trouble installing or compiling FreeCAD? Get help here.
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 » Fri Oct 21, 2016 2:26 am

Hi gdo,
gdo35 wrote:But support can be easily removed, just a matter of choices. ;)
It's just that if you make OCCT depend on a version of VTK from the Ubuntu repository, I think it won't be possible to build FreeCAD with a different VTK version (v7 for example).

The best would be to find a way to not depend on some of the OCCT modules (mainly, visualization) when building FreeCAD. That way, any VTK version could be used with FreeCAD, the one from the Ubuntu repositories, or one that the PPA would hypothetically provide. Unfortunately I haven't found how with our liboce packages, it seems that they all depend on each other, no matter that I specified specific liboce packages in the control file, one of them depended on visualization...

Maybe it will be different with your modules. :)
gdo35 wrote:Just see it as an helper. Launch a local packaging with debuild command. At the end of the process, you will have all needed files and you just have to remove the script.sh and its call in debian/rules to have what you need. ;)
Okay, I'll try this out over the weekend. :)
User avatar
sgrogan
Posts: 6205
Joined: Wed Oct 22, 2014 5:02 pm

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

Postby sgrogan » Sat Oct 22, 2016 12:06 am

Hello guys!
I'll try to be more clear of my opinions.
As NormandC has pointed out FreeCAD doesn't need, nor uses OCCT with USE_VTK. In the official Debian/Ubuntu repos packages are usually built with every available option. I would encourage gdo35 to create the broadest possible package and try to get it into the official repos. @gdo35 you are ahead of the curve here. For FreeCAD Maintainers I would like the lightest package possible.
VTK is even more so (as a standalone package). For full FreeCAD functionality we only need VTK6 >= 6.2. We need >= 6.0 for core FreeCAD and >= 6.2 only for FEM post processing. The motivation for a VTK7 package is two fold, both folds related.
Unlike OCC, VTK is a dependency of many other packages. The official repo versions must be built with every conceivable option, bell, and whistle. Every version of VTK6 seems to come with a peculiar problem when linking against FreCAD. A minimal version of VTK7 seems to overcome these problems. Because there are no VTK7 packages in the repos it can co-exist with the users normal /vtk and not interfere with the packages that depend on it. so
1) smaller package for FreeCAD to minimize "bloat"
2) don't pull in "phantom" dependencies
Other opinions are encouraged.
"fight the good fight"
gkv311
Posts: 6
Joined: Mon Oct 24, 2016 8:02 am

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

Postby gkv311 » Mon Oct 24, 2016 8:48 am

sgrogan
As NormandC has pointed out FreeCAD doesn't need, nor uses OCCT with USE_VTK. In the official Debian/Ubuntu repos packages are usually built with every available option.
From my point of view, it would be inconvenient including dependency from VTK to "entire" OCCT package, since VTK support is an extension for OCCT introducing a couple of new libraries, not core functionality.

Here is a set superficial overview of OCCT 3rdparties:
  • FreeType, mandatory for Visualization module.
    Used directly by TKService and TKOpenGl toolkits.
    Required by visualization for drawing text labels.
    Also can be used for adding text into model as geometry (TopoDS_Shape), e.g. by using Font_BRepTextBuilder class.
  • FreeImage, optional, but still very useful dependency for Visualization module.
    Used directly by TKService toolkit for image import/export from/to external formats.
    Main use cases - loading textures for OCCT 3D Viewer and creating an image dumps,
    but it can be used by applications for working with images independently from OCCT 3D Viewer.
    Applications can avoid this dependency by using own image import/export routines
    (e.g. reusing image plugins provided by Qt and implemented within QImage class).
  • gl2ps, optional for Visualization module.
    Used directly by TKOpenGl toolkit for dumping OCCT 3D viewer content into vector formats (svg/pdf) using deprecated OpenGL functionality.
    Applications should avoid using this deprecated functionality, but it is harmless and low-weight.
  • Tcl/Tk, mandatory for Draw Harness module.
  • 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).
  • VTK, optional for Visualization module.
    This dependency does NOT add any new functionality to existing OCCT toolkits.
    Instead, it ADDs a couple of new toolkits to another two OCCT modules - TKIVtk to Visualization module and TKIVtkDraw to Draw Harness module.
Considering this dependency list, it does not look reasonable building OCCT with all dependencies just for completeness, and it is a tricky point to split OCCT into Debian packages.

Ideally for application will be putting every single OCCT toolkit into dedicated Debian package, so that application will not require installing unused components. For instance, TKService might be useful for applications not using OCCT 3D Viewer; and particular Draw Harness plugins should depend only on corresponding toolkits from other modules - otherwise Draw Harness as module would depend on entire OCCT. So as TKIVtk, which will be useful only for a small number of applications, which would like using VTK as visualization toolkit, but don't want using TKOpenGl.

Spitting into modules can be done as meta-packages for simplifying installation for new users, while properly packaged application will depend only from libraries necessary for their work. Like in case of FFmpeg project defining independent packages for each library and application (ffmpeg, libavcodec, libswscale, libavutil, libavformat and others).

Code: Select all

FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE 
Of course, in case of OCCT it will be more massive list.
But relying on OCCT service files, this list can be generated.
User avatar
sgrogan
Posts: 6205
Joined: Wed Oct 22, 2014 5:02 pm

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

Postby sgrogan » Tue Oct 25, 2016 12:15 am

gkv311 wrote:From my point of view, it would be inconvenient including dependency from VTK to "entire" OCCT package, since VTK support is an extension for OCCT introducing a couple of new libraries, not core functionality.
Hello gkv311! Welcome to FreeCAD and the Forum :) And this discussion :)
Could you explain a little about your background? You seem to have an in depth knowledge of OCCT that could be valuable here.
EDIT: @gkv311 Are you kgv on the OCCT forum?
"fight the good fight"
gkv311
Posts: 6
Joined: Mon Oct 24, 2016 8:02 am

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

Postby gkv311 » Wed Oct 26, 2016 8:46 pm

sgrogan wrote:@gkv311 Are you kgv on the OCCT forum?
Yes, its me.
User avatar
sgrogan
Posts: 6205
Joined: Wed Oct 22, 2014 5:02 pm

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

Postby sgrogan » Wed Oct 26, 2016 8:47 pm

Well a double welcome then :D Thanks for your interest!
"fight the good fight"
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

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

Postby gdo35 » Thu Nov 03, 2016 9:13 am

Hello all,

Sorry for the long absence, I was sick ..., thanks to first winter viruses. :lol:
gkv311 wrote:

Code: Select all

FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE 
Of course, in case of OCCT it will be more massive list.
But relying on OCCT service files, this list can be generated.
Yes, that is the goal of the script I described before.

So what I can do is to package OCCT without VTK and I provide here the debian folder as before.
I will try to do that today. ;)
User avatar
sgrogan
Posts: 6205
Joined: Wed Oct 22, 2014 5:02 pm

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

Postby sgrogan » Thu Nov 03, 2016 11:01 pm

gdo35 wrote: Sorry for the long absence, I was sick ..., thanks to first winter viruses. :lol:
Hope your feeling better!
It's FreeCAD, It's done when it's done. Continued thanks for your efforts.
"fight the good fight"
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 » Fri Nov 04, 2016 3:14 am

+1

O/T These days I've put FreeCAD aside and I picked up my acoustic guitar again... I haven't played it much in the years I've joined the FreeCAD community. Still building back calluses on my left hand's fingertips, ouch! :? I may merge both interests though, for years I've wanted to model it in FreeCAD. microelly's BSpline macro may help. :D
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 » Mon Feb 20, 2017 6:43 am

Bump!

I would really like this project to happen. I'm tired of being stuck with OCC 6.8.0 on the daily PPA. :(

I've re-read the whole topic and looked into gdo's last files. Downloaded the OCCT 7.1.0 tarball too.

@ sgrogan: I just noticed you pushed an OCCT git repo of 7.0.0 on Launchpad last October. We need to update it to 7.1.0. I believe there are packaging tools to manage upstream versions, see git-buildpackage. The description in Synaptic says
This package contains the following tools:
* gbp import-orig: import a new upstream version into the git repository
I'd like to try using this tool to update the repo, I need to get back into the game. If I succeed I'll document.

EDIT: not sure this debian packaging stuff is appropriate. Pure git may be more suited here, it's not the debian packaging repo.

(I just did a fresh 16.04 install last week, formatted everything so I have to get all my devel stuff back again (Launchpad SSH & OpenPGP keys :? )

What gkv311 suggested was very interesting, but complicates things. I think we could start with where gdo left off, and with the same number of packages as current liboce then we see what can be done next.

Considering
gkv311 wrote: Ideally for application will be putting every single OCCT toolkit into dedicated Debian package, so that application will not require installing unused components.
I'm not sure how that can be done. VTK needs to be set as build depend to build the TKIVtk (Vizualisation) and TKIVtkDraw (Draw harness) toolkits. Even if packages were to be built for each and every toolkit, when you install the module metapackage (*-visualization, -draw) it will pull the vtk dependency...