Page MenuHomeFreeBSD

cad/opencascade: switch to VTK-9
ClosedPublic

Authored by thierry on Jun 28 2021, 9:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 18 2024, 5:39 AM
Unknown Object (File)
Jan 26 2024, 8:28 PM
Unknown Object (File)
Dec 30 2023, 11:46 PM
Unknown Object (File)
Dec 23 2023, 1:17 AM
Unknown Object (File)
Aug 25 2023, 11:59 PM
Unknown Object (File)
Aug 17 2023, 8:20 PM
Unknown Object (File)
Jun 30 2023, 6:37 AM
Unknown Object (File)
May 8 2023, 5:42 AM
Subscribers

Details

Summary

Neal Nelson is working on porting the latest version of a library called OCP (cad/py-ocp) which is the foundation of CadQuery.
For this project, OpenCascade needs to switch to VTK-9.

Because VTK-9 introduced a clash with Xutil.h, some patches are needed.

Firstly, the patch submitted in PR 256876 for math/vtk9 is required: see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256876 .

Secondly the patch attached to this differential will be committed if no problem is detected with the consumers.
These patches come from the master branch of OCCT 7.6.0dev, provided by Kirill Gavrilov.

Test Plan

Please check that this patch does not introduce any problem for its consumers, especially FreeCAD.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

thierry created this revision.

FreeCAD needs to be patched to work with vtk9 - see attached (show be possible to git am). Patch from upstream 0cfea3fee3e7848bbf043d2b1a19f6405d7ebe25 (has to happen at the same time as switching opencascade, feel free to apply and push yourself)

Thanks Christoph.

There is an interesting thread about it at https://forum.freecadweb.org/viewtopic.php?f=4&t=46934&start=40 with patches from the Fedora's maintainer.

With the attached patch, it builds fine, but there is an error in poudrière, and I have not yet solved it:

=>> Checking for filesystem violations... done
=>> Error: Filesystem touched during build:
extra: usr/local/lib/python3.8/site-packages/shiboken2/__pycache__
extra: usr/local/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__pycache__
extra: usr/local/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/signature/__pycache__
extra: usr/local/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/signature/lib/__pycache__
extra: usr/local/lib/python3.8/site-packages/PySide2/__pycache__
build of cad/freecad | FreeCAD-0.19.2_1 ended at Wed Jun 30 20:13:47 CEST 2021
build time: 00:49:42
!!! build failure encountered !!!
[00:49:53] Error: Build failed in phase: build_fs_violation

Port patch:

What's in the forum is the more or less the same as was committed upstream. I'll go with the upstream patch - just as I did in https://reviews.freebsd.org/F24561886 - as "using upstream" results in a generally smoother maintenance experience later on.

  • why do want change the compiler/C++ version? FreeCAD builds fine with the "-std=gnu++11" we get from the current setting
  • that BUILD_FEM_VTK is not user-settable, it's always set in SetupSalomeSMESH.cmake by the horrible vtk logic there, so we shouldn't pretend to touch it (before anyone gets the wrong idea)
  • actually, we now don't need the VTK_DIR anymore: it's long gone from FreeCAD's cmake files
  • but then, on further analysis, the vtk module detection is broken (perhaps was broken for some time?) and the vtk module names have been changed
  • I'm not opposed to the VTK_VER logic, even if the gain in FreeCAD is rather small

The result of that is:

and that passes poudriere and doesn't immediately explode.

Great!

(About the change compiler:c++17-lang: the log is full of "warning: use of the 'nodiscard' attribute is a C++17 extension" and I was trying to eliminate them, but you are right, it does not matter)

Now we need to synchronize: do not hesitate to commit this change in cad/opencascade together with yours of cad/freecad.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 7 2021, 7:56 AM
This revision was automatically updated to reflect the committed changes.