<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoPlainText">Thanks for the suggestion, but that didn't make any difference.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">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.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">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://www.mesa3d.org/relnotes/17.1.6.html">https://www.mesa3d.org/relnotes/17.1.6.html</a>) say this, which I don't completely understand:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText" style="margin-left:.5in">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.<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoPlainText">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.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-- Steve<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">On 8/29/18, 7:03 AM, "Elvis Stansvik" <elvis.stansvik@orexplore.com> wrote:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> I've only ever built with Cocoa. But it looks like VTK is using<o:p></o:p></p>
<p class="MsoPlainText"> find_package(OpenGL ...) to find OpenGL, which in turn<o:p></o:p></p>
<p class="MsoPlainText"> (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC<o:p></o:p></p>
<p class="MsoPlainText"> "OpenGL library for OS X") to find the library.<o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText"> Where find_library looks for macOS frameworks can be controlled using<o:p></o:p></p>
<p class="MsoPlainText"> CMAKE_FRAMEWORK_PATH<o:p></o:p></p>
<p class="MsoPlainText"> (https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH),<o:p></o:p></p>
<p class="MsoPlainText"> so perhaps try with<o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText"> -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are<o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText"> HTH,<o:p></o:p></p>
<p class="MsoPlainText"> Elvis<o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText"> 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) <stephen.langer@nist.gov>:<o:p></o:p></p>
<p class="MsoPlainText"> > Hi --<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > I finally need to actually solve a problem I encountered a year ago... How<o:p></o:p></p>
<p class="MsoPlainText"> > do I get vtk to use the correct version of OpenGL on macOS using X11?<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > I downloaded and built CylinderRenderingProperties from the VTK examples<o:p></o:p></p>
<p class="MsoPlainText"> > site. When I run it, it says<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > Warning: In<o:p></o:p></p>
<p class="MsoPlainText"> > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx,<o:p></o:p></p>
<p class="MsoPlainText"> > line 804<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with OpenGL<o:p></o:p></p>
<p class="MsoPlainText"> > version 3.2 but it appears it has been given a context that does not support<o:p></o:p></p>
<p class="MsoPlainText"> > 3.2. VTK will run in a compatibility mode designed to work with earlier<o:p></o:p></p>
<p class="MsoPlainText"> > versions of OpenGL but some features may not work.<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > and then seg faults.<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF.<o:p></o:p></p>
<p class="MsoPlainText"> > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was also<o:p></o:p></p>
<p class="MsoPlainText"> > installed via MacPorts.<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and<o:p></o:p></p>
<p class="MsoPlainText"> > VTK_USE_X11=OFF, then it uses OpenGL from<o:p></o:p></p>
<p class="MsoPlainText"> > /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties<o:p></o:p></p>
<p class="MsoPlainText"> > compiles and runs correctly.<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > Do I need to do something special when building or using VTK to get it to<o:p></o:p></p>
<p class="MsoPlainText"> > find the correct version of OpenGL?<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > (I'm running macOS High Sierra, but the problem existed with the previous OS<o:p></o:p></p>
<p class="MsoPlainText"> > as well.)<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > Thanks.<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > -- Steve<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > _______________________________________________<o:p></o:p></p>
<p class="MsoPlainText"> > Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=zw2bxe3tqPD5fssLtnBuG%2FRl85OjPbTsfcC91Z%2BOw8o%3D&reserved=0<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > Visit other Kitware open-source projects at<o:p></o:p></p>
<p class="MsoPlainText"> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=PcYBqXP0j4eVWPzKggeLrqAQ7WiY9LnNtUkiZDxknRs%3D&reserved=0<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > Please keep messages on-topic and check the VTK FAQ at:<o:p></o:p></p>
<p class="MsoPlainText"> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=uGa1FqKpH99%2FCE%2F6fuqHCtHT1aB8ZIF1whf3WOAbU5E%3D&reserved=0<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=W8JHLG0N9x3mhkk4XC3ESXsQxcbq73fpsp0zArKboPQ%3D&reserved=0<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> > Follow this link to subscribe/unsubscribe:<o:p></o:p></p>
<p class="MsoPlainText"> > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=ez3xU4rzNT7kcWNTGsTOKs8HleLU1ykmGsgigHwvwxU%3D&reserved=0<o:p></o:p></p>
<p class="MsoPlainText"> ><o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
</div>
</body>
</html>