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

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: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by sgrogan »

wandererfan wrote:ShapeString uses "FreeType" not "FreeImage". I would think "FreeImage" was for the ImageWB or for screen grabs.
:oops: Of course you are correct.
gdo35 wrote:And do we use VTK 6.2 ?
It was not decided in previous post.
We don't need to build OCCT with USE_VTK. We need VTK to build FreeCAD but not OCCT.
If I read blacey's post correctly
OSX's OCCT build with FreeImage, with TBB (already leading the way), without VTK
Win's OCCT build with FreeImage,without TBB, without VTK, I plan to try to upgrade the win build to use TBB

I suggest that for the FreeCAD PPA Ubuntu build should be with FreeImage, with TBB, without VTK. @gdo35, if you are ambitious and think you may want to get the OCCT7 package into the official Debian/Ubuntu repo's you'll have to think about VTK. For FreeCAD we don't need it.

When we have a working OCCT7 we will need to build nglib against it. This will require a patched nglib. As far as I know we have 3 choices;
1) wmayer has provided a patch against 5.1 for win, I haven't got it to work yet on win and haven't tried on linux
2) vejmarie has posted a 5.3 patched branch. This is being used by self-compilers on debian jessie and I believe this is what blacey is using for OSX
3) looo has posted a branch for 6.1 and submitted patches upstream that are not yet merged. Needed changes to FreeCAD master have been merged. It will not build on Win due to compiler not supporting some of the C++11 features with VS2013.
I prefer 3) We would need to use the NetGen 6.x sources and apply looo's changes as a patch in the debian folder. Easy to say, I have no idea how to do it :( It seems this is the "proper" way). nglib is needed for MESH_PART and FEM.

Without nglib, FreeCAD can be compiled. In the Mesh Design WB only standard and Mefisto will be available with Create mesh from shape. I think the 3D printing crowd likes the quad dominated option that NG allows. The FEM WB looses integrated meshing. There is a GMESH macro that works well and parts can be meshed in an older version, that has netgen support, and imported into a newer version. Hopefully this can be avoided, it's been this way on win for months and I feel like an ass.

Only VTK6 is required. SMESH (3rd party code integrated into FreeCAD needs it). 6.2 is needed only for FEM post processing. It only effects Trusty on Ubuntu, and FreeCAD simply disables the specific FEM post-processing that uses 6.2, FEM works otherwise. Long term goal could be to provide a FreeCAD-centric minimal VTK7 package (this is what is being done on OSX and Win).
"fight the good fight"
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

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

Post by blacey »

sgrogan wrote: 2) vejmarie has posted a 5.3 patched branch. This is being used by self-compilers on debian jessie and I believe this is what blacey is using for OSX
FYI, the patch set that is be applied to nglib 5.3 for macOS builds is available here
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

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

Post by gdo35 »

Hello all,

Here is a new status about packaging OCCT.
I took into account your feedbacks and made the choice to not mimic OCE as suggested. Because OCCT CMake and build organization is really well done and in some ways prepare packaging.

If you look inside file adm/MODULES, we can consider each module as a package :

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 FWOSPlugin 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
The first field of each line is the module name and next are the libraries it could contain. I insist on "could" because it depends on which CMake flag we used. So it is easy to find lib file associated to each module and then to create associated *.install files for binary packages.

Next step is to create *.install files for development packages. Again code organization is well done as for each library from adm/MODULES file, there is a directory src/<lib_name> containing a file src/<lib_name>/PACKAGES listing all sub-modules needed. In the same way, each sub-modules list files in src/<sub_module_name>/FILES. With the right regular expression (as the one used in previous posts) we can extract all files that should be in development package.

The only problem is that I have the file name but not its folder once install is done. The solution is to launch the script that create *.install file once the debian/tmp is created and filled. This folder represents files as installed in rootfs. In the debuild command process, it is done in the dh_autoinstall command. I modified debian/rules to add call to my script in override_dh_autoinstall. The script search for each file in debian/tmp folder and copy the final path to the *.install file.

As I can dynamically generate *.install files, it easy to generate debian/control file too. I do that directly in the script. To be more sexy, I should create control file from a template (some kind of debian/control.in). But it does not matter for now.

With remaining files (mainly docs and misc stuff under /usr/share/opencascade), I created a package called opencascade-misc also containing DRAWEXE.
Except that last package which is not a library one, lib packages are all multiarch.

I added VTK, TBB and FreeImage support.

About VTK, It will have to be tested as I link with libvtk6.3 from ubuntu 16.10 repository. OCCT normally supports libvtk6.1 but a simple patch removing vtkRenderingFreeTypeOpenGL from this file does the trick :

Code: Select all

src/TKIVtk/EXTERNLIB
src/TKIVtkDraw/EXTERNLIB
For more informations about that trick :
http://www.visitusers.org/index.php?tit ... .3_Upgrade

I added lintian overrides nearly similar to OCE.

To build the package, just decompress debian.tar.gz (in attachment) into OCCT source folder and run :

Code: Select all

debuild -uc -us  -j$(nproc) --lintian-opts --profile debian
Have a coffee (2 if you do not have a computer with SSD and i7 ^^) and report me bugs. ;)

FYI, I use Ubuntu Mate 16.10 64bits.

Enjoy,
gdo
Attachments
debian.tar.gz
(2.28 KiB) Downloaded 73 times
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan »

gdo35 wrote:About VTK, It will have to be tested as I link with libvtk6.3 from ubuntu 16.10 repository. OCCT normally supports libvtk6.1 but a simple patch removing vtkRenderingFreeTypeOpenGL from this file does the trick :

Code: Select all
src/TKIVtk/EXTERNLIB
src/TKIVtkDraw/EXTERNLIB
This bug seems isolated to vtk6.1, so we need a debian jessie tester. On Ubuntu Trusty uses 6.0 and then it jumps to >= to 6.2. 6.2 specifically has an unmet dependency on libproj-dev.
I'll try to test on Trusty but it will not be today.
"fight the good fight"
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

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

Post by gdo35 »

@sgrognan

Sorry I was not clear, the patch is for libvtk6.3, not libvtk6.1.
OCCT is made to build with libvtk6.1.

But i dont know with libvtk6.0 and 6.2
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan »

gdo35 wrote:Sorry I was not clear, the patch is for libvtk6.3, not libvtk6.1.
Ouch, FreeCAD has problems with vtk6.1 :cry: It's not a problem for Ubuntu, but the recommended solution for Debian Jessie for now has been to compile VTK7 yourself.
See Here: http://freecadweb.org/tracker/view.php?id=2740
"fight the good fight"
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

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

Post by gdo35 »

OCCT will support VTK7 in next release (but dont know when... :? ) :
https://tracker.dev.opencascade.org/view.php?id=27672

If it is a Qt5 support problem and if FreeCAD do not need VTK7, maybe we should just repackage VTK6.x on Jessie and make it available on PPA ?
As I understand from the bug you gave the problem is in the Qt5 support, not in VTK itself.

Package maintenance could be really painful and we could lead to conflicts with native packages...
Unless FreeCAD explicitely need VTK7, it seems safer to rely on OCCT VTK6 certified version as OCCT will be the core dependency.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

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

Post by NormandC »

As sgrogan already posted a few replies above, we don't need to build OCCT with VTK. FreeCAD doesn't use the visualization components from either of them and VTK is used directly by FreeCAD.

Using VTK7 is required to get all the functionality in FEM.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

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

Post by NormandC »

gdo35 wrote:The only problem is that I have the file name but not its folder once install is done. The solution is to launch the script that create *.install file once the debian/tmp is created and filled.
This is very ingenious gdo, but I seriously doubt a partial debian folder will work in Launchpad. AFAIK it expects it to be complete, it can't build it on the go.

The Launchpad packaging process first builds a source package, then it builds the binary packages. With your method, you can't get a working source package since the *.install files are generated during the binary package build process.
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

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

Post by gdo35 »

NormandC wrote:As sgrogan already posted a few replies above, we don't need to build OCCT with VTK. FreeCAD doesn't use the visualization components from either of them and VTK is used directly by FreeCAD.

Using VTK7 is required to get all the functionality in FEM.
As it does not cost so much in OCCT context, I just add support for VTK. And if I understood well it could be a condition to make it accepted in the official Ubuntu/Debian repos.
But support can be easily removed, just a matter of choices. ;)
NormandC wrote:This is very ingenious gdo, but I seriously doubt a partial debian folder will work in Launchpad. AFAIK it expects it to be complete, it can't build it on the go.

The Launchpad packaging process first builds a source package, then it builds the binary packages. With your method, you can't get a working source package since the *.install files are generated during the binary package build process.
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. ;)
I have created an unused ppa for personnal project, I'll use it to give it a try.
Post Reply