<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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">OSX does come with OpenGL, but not the X11 parts of it.  There's no glx.h in /System/Library/Frameworks/OpenGL.framework/Headers, and the libraries don't define glXChooseFBConfig and other symbols used by VTK.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Just firing up ccmake and not making any changes to the configuration gives VTK_USE_X=OFF and VTK_USE_COCOA=ON, but I want them the other way around.  Changing those two settings but nothing else makes it try to link to the OpenGL.framework,
 and the build fails because the framework doesn't support X11.   Pointing OPENGL_INCLUDE_DIR, OPENGL_gl_LIBRARY, and OPENGL_glu_LIBRARY to the mesa components lets VTK build, but it gives a warning at run time when it checks the OpenGL version, and then crashes.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The reason for doing this is that many (most?) ports in macports use X11 instead of Cocoa/Quartz, and it's difficult to mix the two.  Our software will be easier to distribute if it can be built to use either X11 or Cocoa.   Also, we're
 using gtk2, and it works better in X11.  (Someday we'll upgrade to gtk3…) <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-- Steve<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Ken Martin <ken.martin@kitware.com><br>
<b>Date: </b>Monday, January 29, 2018 at 3:21 PM<br>
<b>To: </b>"Langer, Stephen A. (Fed)" <stephen.langer@nist.gov><br>
<b>Cc: </b>"vtkusers@vtk.org" <vtkusers@vtk.org><br>
<b>Subject: </b>Re: [vtkusers] vtk getting wrong OpenGL version number from mesa and macports<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a name="_MailOriginalBody">I'm pretty sure OSX comes with OpenGL and OSX always provides at least OpenGL 3.2 as of any version of OSX in the past few years. I'm not an OSX wizard, but generally default vtk builds straight out of the box
 last I checked. Maybe try a clean VTK build using all the defaults and see if that works.<o:p></o:p></a></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">On Mon, Jan 29, 2018 at 3:08 PM, Langer, Stephen A. (Fed) <</span><a href="mailto:stephen.langer@nist.gov" target="_blank"><span style="mso-bookmark:_MailOriginalBody">stephen.langer@nist.gov</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody">>
 wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">Hi --<br>
<br>
I'm revisiting earler efforts to get vtk working with X11 on macOS.  I'd been building vtk with Cocoa because with X11 vtk was complaining that it couldn't find OpenGL version 3.2 or later.  I'm using macports to install OpenGL (mesa), and supposedly it's providing
 version 4.5 of OpenGL.<br>
<br>
I've tried building vtk both with and without VTK_USE_SYSTEM_GLEW, since vtk gets the version number from glew.  I tried tracing though the process of getting the version number, starting with vtkOpenGLRenderWindow::OpenGLInitContext(), but found the glew code
 to be amazingly opaque.   All I know for sure is that in vtk's OpenGLInitContext, GLEW_VERSION_3_2 and GLEW_VERSION_3_1 are empty, but the glew source code *does* set them, in glewContextInit() in glew.c.  I don't know what it sets them *to*, though.<br>
<br>
I'm using the latest vtk from git master, but the problem occurred with released versions too.<br>
<br>
I don't know if this is a vtk problem or a macports problem or a mesa problem, but I didn't get a helpful answer from the macports list.  Any advice would be much appreciated.<br>
<br>
Thanks.<br>
<br>
 -- Steve<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by </span><a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com&data=02%7C01%7Cstephen.langer%40nist.gov%7Cd81105051dfb4459448608d56755ea88%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636528541064005648&sdata=F2wPxiex5QUmuUGkeVEarcyg9IaVHvm3MFtXlOuqzy4%3D&reserved=0" target="_blank"><span style="mso-bookmark:_MailOriginalBody">www.kitware.com</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
Visit other Kitware open-source projects at </span><a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Cstephen.langer%40nist.gov%7Cd81105051dfb4459448608d56755ea88%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636528541064005648&sdata=0MNUl0g8WhwA%2FNiAvD43MKiyLbnrbSci7wF%2FA3zlp9o%3D&reserved=0" target="_blank"><span style="mso-bookmark:_MailOriginalBody">http://www.kitware.com/opensource/opensource.html</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: </span><a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Cstephen.langer%40nist.gov%7Cd81105051dfb4459448608d56755ea88%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636528541064005648&sdata=uwcnlxQgdLLCAroFc5KKJUctO57csZYRVsU4mdhKNK0%3D&reserved=0" target="_blank"><span style="mso-bookmark:_MailOriginalBody">http://www.vtk.org/Wiki/VTK_FAQ</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
Search the list archives at: </span><a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7Cd81105051dfb4459448608d56755ea88%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636528541064005648&sdata=J76wTqPvHvNvL5gaxyoH%2B487hYPwZA%2BAgsyYUmoDyqU%3D&reserved=0" target="_blank"><span style="mso-bookmark:_MailOriginalBody">http://markmail.org/search/?q=vtkusers</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</span><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7Cd81105051dfb4459448608d56755ea88%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636528541064005648&sdata=YCFiL%2BOsTIVdNZnJ0h2XHEc1LtxyTajiAK6LpfNv9yE%3D&reserved=0" target="_blank"><span style="mso-bookmark:_MailOriginalBody">https://vtk.org/mailman/listinfo/vtkusers</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></p>
</blockquote>
</div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><br>
<br clear="all">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">-- <o:p></o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">Ken Martin PhD <o:p>
</o:p></span></p>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">Distinguished Engineer<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:9.5pt">Kitware Inc.</span></span><span style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">28 Corporate Drive<br>
Clifton Park NY 12065<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">This communication, including all attachments, contains confidential and legally privileged information, and it is intended only
 for the use of the addressee.  Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication
 in error please notify us immediately and destroy the original message.  Thank you.</span></span><span style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>