Wed, 06/23/2021 - 19:30
Forums:
Hello, OpenCascade 7.5.0 builds fine against VTK-8, but I tried to switch to VTK-9 and it fails.
I already reported the problem to VTK: see Kitware's gitlab, issue 18240, but the problem seems hard to fix on their side: has anyone succeeded to build OpenCascade against VTK-9?
Thanks!
Wed, 06/23/2021 - 20:57
Could you please fix the URL to external Bugtracker in your message and put some information about the problem here?
As far as I know, it is technically possible building OCCT with VTK-9, so I'm curious what exactly happens in your scenario.
Wed, 06/23/2021 - 21:00
Hello,
I cannot post the exact URL, because it is rejected by the the forum.
Trying in two parts: gitlab.kitware.com/vtk/vtk/-/issues/18240 and add a scheme for secured http.
Thanks.
Thu, 06/24/2021 - 10:49
This is a common macros clash issue with system headers. New VTK introduced an unfortunate enumeration value "AllValues" defined also in Xutil.h as macros.
It is nice to avoid name clashes when they observed by renaming them in a library (as system X11 headers will certainly not do that - these name clashes with windows.h on Windows, X11 on Linux and even Cocoa on macOS happened more than decade ago and haven't been treated anyhow). But I guess VTK developers already decided not to do that.
In this case, the only options are to avoid including VTK and X11 headers in a single .cxx file, or to use macros #undef tricks.
Currently developed master branch of OCCT 7.6.0dev already contains the fix integrated with the following bug
(note that patch also fixes one other problem with VTK9 leading to crashes):
0032331: Visualization - Exception when trying to display some surfaces using iVtk with VTK 9
The patch for X11 name clash is trivial though:
Sat, 06/26/2021 - 18:22
Thanks! This is not sufficient to fix the problem, but I'll try to go continue with this. ATM the new failures are:
But anyway, I'm surprised that people can build OpenCascade against VTK-9 without patches!
Mon, 06/28/2021 - 14:59
I meant only that I was able to compile OCCT 7.5.0 with VTK-9 on Windows, I haven't tried this on other platforms.
Within the current state OCCT 7.6.0dev it should be compilable on Linux as well (as it should be now regularly checked on Jenkins since #0032331).
OK, I see the problem. It seems that there are more patches in OCCT 7.6.0dev interfering with VTK9 problem (TKOpenGl headers have been clean up in scope of unrelated bug).
To workaround the issue on OCCT 7.5.x, you need to put the same fix as in previous message into IVtkDraw.cxx - somewhere between Aspect_DisplayConnection.hxx and IVtk_Types.hxx.
Mon, 06/28/2021 - 20:32
Yes! this does the trick: these two patches (plus the one for VTK-9) are sufficient!
Thanks (this ticket can be closed).