Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
> On 15 Sep 2015, at 03:51, Thiago Macieira wrote: > > On Monday 14 September 2015 08:09:28 Sorvig Morten wrote: >> Then the question is: which ones should QtGui link against? On other words >> OpenGL usage is not confined to platform plugins only. >> >> To me this points to Xcb or Cocoa being a configure-time choice. > > Shouldn't the OpenGL functions be resolved dynamically by the platform > plugin? > QtGui should not link to the GL library. We had to implement that > functionality for Windows, so that desktop GL and ANGLE could be selected at > runtime. > > This would also allow one QtGui to work with both desktop GL as well as GL ES > in one build (though it could be disabled if one of the two can never happen). I did a quick survey of OpenGL usage by removing the frameworks from the linker line: QtGui : OpenGL function usage sems mostly contained to QOpenGLFunctions(Private): https://paste.kde.org/posonryeq QtQuick: Links against OpenGL and AGL but does not appear to use any symbols. Qt3D (core, render): Links against OpenGL and AGL but does not appear to use any symbols. What do we do for OpenGL headers? Looks like src/gui/opengl/opengl.h uses native headers for Q_OS_MAC and the official Khronos headers for other platforms. Morten ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On 15/09/15 03:51, "Thiago Macieira" wrote: >On Monday 14 September 2015 08:09:28 Sorvig Morten wrote: >> Then the question is: which ones should QtGui link against? On other >>words >> OpenGL usage is not confined to platform plugins only. >> >> To me this points to Xcb or Cocoa being a configure-time choice. > >Shouldn't the OpenGL functions be resolved dynamically by the platform >plugin? >QtGui should not link to the GL library. We had to implement that >functionality for Windows, so that desktop GL and ANGLE could be selected >at >runtime. > >This would also allow one QtGui to work with both desktop GL as well as >GL ES >in one build (though it could be disabled if one of the two can never >happen). In principle that’s ok. But for 5.6, our focus should be to have things working with Cocoa. This is the 99.5% use case, xcb is a fringe platform on the Mac. So for 5.6, I agree with Morten that cocoa vs xcb sounds like a configure choice rather than something we do dynamically. For 5.7, we could get things working from one build if someone is willing to do the work required. Cheers, Lars ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Monday 14 September 2015 08:09:28 Sorvig Morten wrote: > Then the question is: which ones should QtGui link against? On other words > OpenGL usage is not confined to platform plugins only. > > To me this points to Xcb or Cocoa being a configure-time choice. Shouldn't the OpenGL functions be resolved dynamically by the platform plugin? QtGui should not link to the GL library. We had to implement that functionality for Windows, so that desktop GL and ANGLE could be selected at runtime. This would also allow one QtGui to work with both desktop GL as well as GL ES in one build (though it could be disabled if one of the two can never happen). -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
> On 13 Sep 2015, at 00:55, Thiago Macieira wrote: > > On Saturday 12 September 2015 18:16:54 René J. V. Bertin wrote: >> Thiago Macieira wrote: >>> Maybe we need two tests: one for OpenGL for XCB plugin (with GLX support) >>> and one for OpenGL for the Cocoa plugin (AGL support). >> >> I think that's what you get when using my approach: > > Not really. I guess I didn't express myself: I meant keep *both* tests, but > use two different variables for storing them: one for OpenGL-for-XCB and one > for OpenGL-for-Cocoa. > > In any case, is there any Apple system that *lacks* the OpenGL libraries? Why > do we need to test for it? Let the configure script detect the XCB one with > pkg-config and let the Cocoa plugin use -framework OpenGL -framework AGL, > pure > and simple. Then the question is: which ones should QtGui link against? On other words OpenGL usage is not confined to platform plugins only. To me this points to Xcb or Cocoa being a configure-time choice. Morten ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Saturday 12 September 2015 18:16:54 René J. V. Bertin wrote: > Thiago Macieira wrote: > > Maybe we need two tests: one for OpenGL for XCB plugin (with GLX support) > > and one for OpenGL for the Cocoa plugin (AGL support). > > I think that's what you get when using my approach: Not really. I guess I didn't express myself: I meant keep *both* tests, but use two different variables for storing them: one for OpenGL-for-XCB and one for OpenGL-for-Cocoa. In any case, is there any Apple system that *lacks* the OpenGL libraries? Why do we need to test for it? Let the configure script detect the XCB one with pkg-config and let the Cocoa plugin use -framework OpenGL -framework AGL, pure and simple. > > On Saturday 12 September 2015 10:03:09 René J.V. Bertin wrote: > >> Can anyone think of a case where you'd be building for Cocoa and NOT use > >> /System/Library/Frameworks/{OpenGL,AGL}.framework ? > > > > When you're building against an SDK and therefore it's not the one in > > /System/Library. > > Well, yes, but as long as you provide the appropriate SDK argument, > -framework OpenGL -framework AGL will still link the correct framework, no? Right, but that's not using the path you mentioned. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
Thiago Macieira wrote: > Maybe we need two tests: one for OpenGL for XCB plugin (with GLX support) and > one for OpenGL for the Cocoa plugin (AGL support). I think that's what you get when using my approach: doOpenGLDesktopTest() { if [ "$QT_QPA_DEFAULT_PLATFORM" = "cocoa" ] || \ [ "$QT_QPA_DEFAULT_PLATFORM" = "" -a "$XPLATFORM_MAC" = "yes" ]; then # QT_QPA_DEFAULT_PLATFORM is either empty or set by the user, # so we have to check both manually and automatically selected cocoa. # It qpa=cocoa, we do NOT want to use pkg-config to find the OpenGL # libraries because it's too likely to find OpenGL libraries that are # not the system frameworks appropriate for cocoa mode. compileTest unix/opengldesktop "OpenGL" else compileTestWithPkgConfig gl unix/opengldesktop "OpenGL" OPENGL fi } > On Saturday 12 September 2015 10:03:09 René J.V. Bertin wrote: >> Can anyone think of a case where you'd be building for Cocoa and NOT use >> /System/Library/Frameworks/{OpenGL,AGL}.framework ? > > When you're building against an SDK and therefore it's not the one in > /System/Library. Well, yes, but as long as you provide the appropriate SDK argument, -framework OpenGL -framework AGL will still link the correct framework, no? R. ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Friday 11 September 2015 21:07:13 Hanspeter Niederstrasser wrote: > It's definitely a problem caused by pkg-config if your pkg-config is set > to search your X11 installation by default (using PKG_CONFIG_LIBDIR at > least can override the default). A conditional that *doesn't* use > pkg-config to find OpenGL on Cocoa would be very nice. Maybe we need two tests: one for OpenGL for XCB plugin (with GLX support) and one for OpenGL for the Cocoa plugin (AGL support). Unless EGL offers support for both. Or Vulkan. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Saturday 12 September 2015 10:03:09 René J.V. Bertin wrote: > Can anyone think of a case where you'd be building for Cocoa and NOT use > /System/Library/Frameworks/{OpenGL,AGL}.framework ? When you're building against an SDK and therefore it's not the one in /System/Library. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Saturday September 12 2015, Hanspeter Niederstrasser wrote regarding "Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries" Hi, >https://bugreports.qt.io/browse/QTBUG-47146 > >It's definitely a problem caused by pkg-config if your pkg-config is set >to search your X11 installation by default (using PKG_CONFIG_LIBDIR at Yes, and that means that in the current state of things you cannot rely on pkg-config to find "system" libraries if you have the X11 OpenGL library installed among those. >least can override the default). A conditional that *doesn't* use >pkg-config to find OpenGL on Cocoa would be very nice. The conditional I posted earlier is very simple: do not use pkg-config when building for the "macx" platform or when building the cocoa qpa plugin. Instead, fall back to the simpler compileTest (which Qt 5.4.2 used in this case) and rely on the fact that the true system OpenGL libraries 1) have a fixed name and 2) will be found without "us" having to search for them. That's also why I said I already contributed a patch; the hardest part was figuring out the correct conditional expression (and then of course putting it into a function because there are 2 places where compileTestWithPkgConfig has to be replaced). Can anyone think of a case where you'd be building for Cocoa and NOT use /System/Library/Frameworks/{OpenGL,AGL}.framework ? R. ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On 9/11/2015 9:19 AM, René J.V. Bertin wrote: > On Friday September 11 2015 14:17:23 René J.V. Bertin wrote: > >> How can I find out why QMAKE_LIBS_OPENGL gets set to -lGL in qmodule.pri, or >> why the library is tested in opengldesktop.pro? > > Answer 1: by sinking teeth where I'd rather not sink them > Answer 2: configure shouldn't use pkg-config when building for the Cocoa QPA, > i.o.w, > > if [ "$QT_QPA_DEFAULT_PLATFORM" = "cocoa" ] || [ "$QT_QPA_DEFAULT_PLATFORM" = > "" -a "$XPLATFORM_MAC" = "yes" ] then compileTest should be used. I cannot > see any reason to justify using pkg-config to find the OpenGL frameworks, > just as it's obvious that it should be used to find the GLX library when > building the XCB plugin. > > Should I file a bug report or is this enough? This is the bug report I previously filed on this: https://bugreports.qt.io/browse/QTBUG-47146 It's definitely a problem caused by pkg-config if your pkg-config is set to search your X11 installation by default (using PKG_CONFIG_LIBDIR at least can override the default). A conditional that *doesn't* use pkg-config to find OpenGL on Cocoa would be very nice. Hanspeter ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Friday September 11 2015 20:18:20 Oswald Buddenhagen wrote: > > if [ "$QT_QPA_DEFAULT_PLATFORM" = "cocoa" ] || [ "$QT_QPA_DEFAULT_PLATFORM" > > = "" -a "$XPLATFORM_MAC" = "yes" ] then compileTest should be used. I > > cannot see any reason to justify using pkg-config to find the OpenGL > > frameworks, just as it's obvious that it should be used to find the GLX > > library when building the XCB plugin. > > > > Should I file a bug report or is this enough? > > > there are some related reports already. > > but what you really should do, is contribute a patch. ;) I actually already provided the patch ;) (but I guess I won't get out from doing a full-blown gerrit even for this...) R ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Fri, Sep 11, 2015 at 04:19:52PM +0200, René J.V. Bertin wrote: > On Friday September 11 2015 14:17:23 René J.V. Bertin wrote: > > > How can I find out why QMAKE_LIBS_OPENGL gets set to -lGL in qmodule.pri, > > or why the library is tested in opengldesktop.pro? > > Answer 1: by sinking teeth where I'd rather not sink them > Answer 2: configure shouldn't use pkg-config when building for the Cocoa QPA, > i.o.w, > > if [ "$QT_QPA_DEFAULT_PLATFORM" = "cocoa" ] || [ "$QT_QPA_DEFAULT_PLATFORM" = > "" -a "$XPLATFORM_MAC" = "yes" ] then compileTest should be used. I cannot > see any reason to justify using pkg-config to find the OpenGL frameworks, > just as it's obvious that it should be used to find the GLX library when > building the XCB plugin. > > Should I file a bug report or is this enough? > there are some related reports already. but what you really should do, is contribute a patch. ;) ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt 5.5.0 build issue on OS X (10.9): OpenGL libraries
On Friday September 11 2015 14:17:23 René J.V. Bertin wrote: > How can I find out why QMAKE_LIBS_OPENGL gets set to -lGL in qmodule.pri, or > why the library is tested in opengldesktop.pro? Answer 1: by sinking teeth where I'd rather not sink them Answer 2: configure shouldn't use pkg-config when building for the Cocoa QPA, i.o.w, if [ "$QT_QPA_DEFAULT_PLATFORM" = "cocoa" ] || [ "$QT_QPA_DEFAULT_PLATFORM" = "" -a "$XPLATFORM_MAC" = "yes" ] then compileTest should be used. I cannot see any reason to justify using pkg-config to find the OpenGL frameworks, just as it's obvious that it should be used to find the GLX library when building the XCB plugin. Should I file a bug report or is this enough? R. ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development