<div dir="ltr"><div>I ran 'glxinfo' under xquartz on my own machine and it reports OpenGL 2.1. This might be a limitation of glx or xquartz, rather than a limitation of the underlying OpenGL libraries or the hardware.</div><div><br></div><div>If you have a linux machine, you can try doing X11 via ssh (with ssh -Y) to see if the results are different on a different xserver.</div><div><br></div><div>And there is also the option of building a full-software Mesa (i.e. unaccelerated). People often do this on Windows, since accelerated graphics don't always work with remote desktop.</div><div><br></div><div>For myself, since I use Windows on VirtualBox which has limited OpenGL support, I'm still building my Windows VTK apps with the old OpenGL backend.</div><div><br></div><div> - David</div><div><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 30, 2018 at 9:11 AM Langer, Stephen A. (Fed) <<a href="mailto:stephen.langer@nist.gov">stephen.langer@nist.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_7440277723129252186WordSection1">
<p class="MsoNormal">Yes, I have all of the X11 libraries and the server installed from MacPorts. X11 programs that don't use vtk, such as glxgears, run correctly. Poking around with "otool -L" shows that glxgears and CylinderRenderingProperties are linking
to the same X and GL libraries, with the possible exception of libvtkglew, which as far as I can tell isn't equivalent to anything loaded by glxgears.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Setting MESA_GL_VERSION_OVERRIDE as Elvis suggested didn't make any difference.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">-- Steve<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">On 8/29/18, 5:43 PM, "David Gobbi" <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Have you installed XQuartz? It provides a full set of headers and libraries for X11 and OpenGL in /opt, and the latest version number listed in its headers is GL_VERSION_4_5.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">It has been many years since I've built VTK with X11 on the Mac, but XQuartz was where I always got the dev files from.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"> - David<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:.5in">
<u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Wed, Aug 29, 2018 at 3:10 PM Langer, Stephen A. (Fed) <<a href="mailto:stephen.langer@nist.gov" target="_blank">stephen.langer@nist.gov</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in">Thanks for the suggestion, but that didn't make any difference.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in">I don't think the problem is the frameworks, actually. I don't believe that the OpenGL framework provided by Apple supports X11, so there's no point in directing vtk towards it.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in">I can get vtk to link to the OpenGL libraries provided by the MacPorts' mesa and libGLU, but when it does, it complains about the OpenGL version. The mesa in MacPorts is version is
17.1.6, which supports OpenGL 4.5, so it ought to work. However, the Mesa release notes (<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mesa3d.org%2Frelnotes%2F17.1.6.html&data=02%7C01%7Cstephen.langer%40nist.gov%7C171ff2b34fed4f31b25808d60df864fd%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711757824634629&sdata=vbhYyPK6rqtl6p64DyEoxfv%2F%2F3RLVs0QEAw9y3X%2Fb74%3D&reserved=0" target="_blank">https://www.mesa3d.org/relnotes/17.1.6.html</a>)
say this, which I don't completely understand:<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:1.0in">Mesa 17.1.6 implements the OpenGL 4.5 API, but the version reported by glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / glGetIntegerv(GL_MINOR_VERSION) depends on the particular
driver being used. Some drivers don't support all the features required in OpenGL 4.5. OpenGL 4.5 is only available if requested at context creation because compatibility contexts are not supported.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:1.0in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in">That doesn't way what version is provided if 4.5 isn't requested. But is it possible that vtk isn't getting the OpenGL context correctly? I tried looking at the code but didn't get
very far. I'm not at all familiar with OpenGL.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in">-- Steve<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in">On 8/29/18, 7:03 AM, "Elvis Stansvik" <<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>> wrote:<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> I've only ever built with Cocoa. But it looks like VTK is using<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> find_package(OpenGL ...) to find OpenGL, which in turn<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> "OpenGL library for OS X") to find the library.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u>
<u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> Where find_library looks for macOS frameworks can be controlled using<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> CMAKE_FRAMEWORK_PATH<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> (<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcmake.org%2Fcmake%2Fhelp%2Flatest%2Fvariable%2FCMAKE_FRAMEWORK_PATH.html%23variable%3ACMAKE_FRAMEWORK_PATH&data=02%7C01%7Cstephen.langer%40nist.gov%7C171ff2b34fed4f31b25808d60df864fd%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711757824644817&sdata=03OJ9GGhZmzvIJjvHpZEWAFEEKzSXT0CJ6SM%2FSkUR5o%3D&reserved=0" target="_blank">https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH</a>),<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> so perhaps try with<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u>
<u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u>
<u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> HTH,<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> Elvis<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> <u></u>
<u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) <<a href="mailto:stephen.langer@nist.gov" target="_blank">stephen.langer@nist.gov</a>>:<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > Hi --<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > I finally need to actually solve a problem I encountered a year ago... How<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > do I get vtk to use the correct version of OpenGL on macOS using X11?<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > I downloaded and built CylinderRenderingProperties from the VTK examples<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > site. When I run it, it says<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > Warning: In<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx,<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > line 804<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with OpenGL<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > version 3.2 but it appears it has been given a context that does not support<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > 3.2. VTK will run in a compatibility mode designed to work with earlier<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > versions of OpenGL but some features may not work.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > and then seg faults.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was also<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > installed via MacPorts.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > VTK_USE_X11=OFF, then it uses OpenGL from<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > compiles and runs correctly.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > Do I need to do something special when building or using VTK to get it to<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > find the correct version of OpenGL?<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > (I'm running macOS High Sierra, but the problem existed with the previous OS<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > as well.)<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > Thanks.<u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> ><u></u><u></u></p>
<p class="m_7440277723129252186gmail-m5243408913016175764msoplaintext" style="margin-left:.5in"> > -- Steve<u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote></div></div>