msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.21k stars 1.19k forks source link

[vtk] problem with vtk compilation with OSMESA offscreen rendering #19726

Open 2manek opened 5 months ago

2manek commented 5 months ago

Description / Steps to reproduce the issue

I want to compile vtk with OSMESA offscreen rendering, instead of default Win32 OpenGL. Based on your PKGBUILD, I only added this cmake flags:

${MINGW_PREFIX}/bin/cmake \
    ...
    -DVTK_USE_WIN32_OPENGL=OFF \
    -DVTK_OPENGL_HAS_OSMESA=ON \
    -DVTK_MODULE_ENABLE_VTK_MomentInvariants=NO \
    -DVTK_MODULE_ENABLE_VTK_RenderingOpenXR=NO \
    -DVTK_MODULE_ENABLE_VTK_RenderingLookingGlass=NO \
    ...

and I added more jobs to copiler, but it shouldn't make any difference:

${MINGW_PREFIX}/bin/cmake --build . -- -j$(nproc)

The compilation was successful, and I installed the generated package without any problems:

pacman -U mingw-w64-ucrt-x86_64-vtk-9.3.0-4-any.pkg.tar.zst

I then successfully compiled the OffScreenRendering example.

Example should produce screenshot.png file, but I got this error instead:

$ ./OffScreenRendering.exe
2024-01-12 11:28:03.616 (   0.164s) [DA4A6AE7A9E48EB7]vtkOpenGLRenderWindow.c:704    ERR| vtkOSOpenGLRenderWindow (0x22cf2c7d930): GLEW could not be initialized: Missing GL version
[1]    9031 segmentation fault  ./OffScreenRendering.exe

Windows Version

$ uname

MINGW64_NT-10.0-19045

I performed the above steps on UCRT64 MINGW environments

MehdiChinoune commented 5 months ago

Please report this issue upstream.

2manek commented 5 months ago

What do you mean? Do you mean the VTK developers website? I posted it there too.

MehdiChinoune commented 5 months ago

What do you mean? Do you mean the VTK developers website? I posted it there too.

yes, I see https://gitlab.kitware.com/vtk/vtk/-/issues/19219

2manek commented 5 months ago

The upstream thread has been closed. However, I managed to solve the problem by using the internal GLEW instead of the external one. So I had to add an extra flag to cmake:

-DVTK_MODULE_USE_EXTERNAL_VTK_glew=OFF