Building VTK with osmesa offscreen support on windows.
This issue pertains to building VTK with OSmesa on Windows.
Using compiled osmesa (version 13.0.2) binaries (from https://anaconda.org/clinicalgraphics/osmesa/13.0.3/download/win-64/osmesa-13.0.3-0.tar.bz2 or from https://lists.freedesktop.org/archives/mesa-users/2017-January/001287.html) and building vtk with options:
-
-DVTK_RENDERING_BACKEND=OpenGL2 ^
-
-DVTK_OPENGL_HAS_OSMESA:BOOL=ON ^
-
-DOPENGL_INCLUDE_DIR:PATH="%LIBRARY_INC%" ^
-
-DOPENGL_gl_LIBRARY="%LIBRARY_BIN%\opengl32.lib" ^
-
-DOSMESA_INCLUDE_DIR:PATH="%LIBRARY_INC%" ^
-
-DOSMESA_LIBRARY:FILEPATH="%LIBRARY_BIN%\osmesa.lib" ^
returns:
..\Rendering\OpenGL2\vtkOSOpenGLRenderWindow.cxx(50): error C2059: syntax error: '('
..\Rendering\OpenGL2\vtkOSOpenGLRenderWindow.cxx(192): error C2065: 'OSMesaCreateContextAttribs_func': undeclared identifier
..\Rendering\OpenGL2\vtkOSOpenGLRenderWindow.cxx(192): error C2146: syntax error: missing ';' before identifier 'OSMesaCreateContextAttribs'
..\Rendering\OpenGL2\vtkOSOpenGLRenderWindow.cxx(193): error C2065: 'OSMesaCreateContextAttribs_func': undeclared identifier
..\Rendering\OpenGL2\vtkOSOpenGLRenderWindow.cxx(194): error C2146: syntax error: missing ';' before identifier 'OSMesaGetProcAddress'
and with -DVTK_RENDERING_BACKEND=OpenGL
returns:
..\Rendering\OpenGL\vtkOpenGLExtensionManager.cxx(725): error C2440: 'static_cast': cannot convert from 'OSMESAproc' to 'vtkOpenGLExtensionManagerFunctionPointer'
..\Rendering\OpenGL\vtkOpenGLExtensionManager.cxx(725): note: This conversion requires a reinterpret_cast, a C-style cast or function-style cast
this issue has also been posted to vtk-users: http://vtk.1045678.n5.nabble.com/Issues-Building-VTK-with-osmesa-on-Windows-td5741720.html