[vtkusers] vtk getting wrong OpenGL version number from mesa and macports

Langer, Stephen A. (Fed) stephen.langer at nist.gov
Mon Jan 29 22:06:00 EST 2018


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.

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.

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…)

-- Steve

From: Ken Martin <ken.martin at kitware.com>
Date: Monday, January 29, 2018 at 3:21 PM
To: "Langer, Stephen A. (Fed)" <stephen.langer at nist.gov>
Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
Subject: Re: [vtkusers] vtk getting wrong OpenGL version number from mesa and macports

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.

On Mon, Jan 29, 2018 at 3:08 PM, Langer, Stephen A. (Fed) <stephen.langer at nist.gov<mailto:stephen.langer at nist.gov>> wrote:
Hi --

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.

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.

I'm using the latest vtk from git master, but the problem occurred with released versions too.

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.

Thanks.

 -- Steve



_______________________________________________
Powered by www.kitware.com<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>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<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>

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<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>

Search the list archives at: http://markmail.org/search/?q=vtkusers<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>

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers<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>



--
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180130/0325a3fa/attachment.html>


More information about the vtkusers mailing list