[vtkusers] OpenGL version error on macOS

Elvis Stansvik elvis.stansvik at orexplore.com
Wed Aug 29 07:02:58 EDT 2018


I've only ever built with Cocoa. But it looks like VTK is using
find_package(OpenGL ...) to find OpenGL, which in turn
(FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC
"OpenGL library for OS X") to find the library.

Where find_library looks for macOS frameworks can be controlled using
CMAKE_FRAMEWORK_PATH
(https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH),
so perhaps try with

    -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are

HTH,
Elvis

2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) <stephen.langer at nist.gov>:
> Hi --
>
>
>
> I finally need to actually solve a problem I encountered a year ago...  How
> do I get vtk to use the correct version of OpenGL on macOS using X11?
>
>
>
> I downloaded and built CylinderRenderingProperties from the VTK examples
> site.  When I run it, it says
>
>
>
> Warning: In
> /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx,
> line 804
>
> vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with OpenGL
> version 3.2 but it appears it has been given a context that does not support
> 3.2. VTK will run in a compatibility mode designed to work with earlier
> versions of OpenGL but some features may not work.
>
>
>
> and then seg faults.
>
>
>
> That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF.
> OpenGL was provided by the MacPorts mesa and libGLU ports.  X11 was also
> installed via MacPorts.
>
>
>
> If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and
> VTK_USE_X11=OFF, then it uses OpenGL from
> /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties
> compiles and runs correctly.
>
>
>
> Do I need to do something special when building or using VTK to get it to
> find the correct version of OpenGL?
>
>
>
> (I'm running macOS High Sierra, but the problem existed with the previous OS
> as well.)
>
>
>
> Thanks.
>
>     -- Steve
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
>


More information about the vtkusers mailing list