Thu, 11/09/2023 - 13:54
I am trying to build the OCCT from source code on my headless Linux machine with the existing VTK package.
I am using the OCCT version 7.7.0 and VTK version 9.3.0
I have built the VTK to support the offscreen/software rendering on Linux headless machine.
I have used below configuration to build the VTK
VTK_RENDERING_BACKEND:STRING=OpenGL2
VTK_USE_X:BOOL=OFF
VTK_OPENGL_HAS_OSMESA:BOOL=ON
I even tried a sample application completely based on VTK to render the sample shape and capture the image of the loaded model and it is working fine.
But when I try to execute the same code through the application where OCCT code is also implemented it is giving the segmentation fault error.
So I tried to build the OCCT with the VTK support and I set the OCCT configuration USE_VTK =true and set the include directories for the both VTK as well as OSMESA.
But while building with the above configuration I am getting below error.
[100%] Building CXX object src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o
/home/vikasb/OCCT/source/opencascade-7.7.0/src/IVtkDraw/IVtkDraw.cxx:81:12: fatal error: vtkXRenderWindowInteractor.h: No such file or directory
81 | #include <vtkXRenderWindowInteractor.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/build.make:76: src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3690: src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
So can anyone help to resolve this error and build the OCCT with the existing installed VTK to support the offscreen/software rendering of model on headless Ubuntu ( 20.04) machine.
Thanks
Thu, 11/09/2023 - 17:17
Hello, We will check your problem with VTK 9.3.0
But as a fast solution, please check version 9.0 of VTK.
Best regards, Dmitrii.
Fri, 11/10/2023 - 14:21
Hi Dmitrii,
As you suggested I tried with the VTK 9.0.0 ( download link https://gitlab.kitware.com/vtk/vtk/-/tags/v9.0.0).
VTK build and installation is successful. The sample application to dump a image using VTK only is also running successfully.
But when try to build the OCCT with the VTK getting the same error.
For error please see attached image.
Can you tell me what is wrong here? am I missing some configuration while building?
Fri, 11/10/2023 - 14:51
I'm not sure, it looks like that VTK was building with specific parameters. I need to check.
Best regards, Dmitrii.
Fri, 11/10/2023 - 15:02
Do you need the configurations parameters I am using while building the VTK?
As well as the configuration parameters for OCCT build
regards,
Vikas
Thu, 11/23/2023 - 09:06
Hi Dmitrii,
Any update on this?
Any workaround which can be used?
Regards
Vikas
Thu, 11/23/2023 - 10:02
You have built VTK without Xlib dependency, which
TKIVtkDraw
library expects.Either you need patching OCCT to support such configuration (like handling
HAVE_XLIB
/USE_XLIB=OFF
withinIVtkDraw
) or disable Draw Harness module (BUILD_MODULE_Draw=OFF
in CMake).Thu, 11/23/2023 - 12:00
Hi gkv
I am using below parameters while building and installing VTK to support the offscreen rendering
VTK_RENDERING_BACKEND:STRING=OpenGL2
VTK_USE_X:BOOL=OFF
VTK_OPENGL_HAS_OSMESA:BOOL=ON
I guess this configuration is required for headless/offscreen rendering.
If this is not correct can you please suggest a way?
Regards
Vikas