bugGNU Octave - Bugs: bug #55883, Octave 5.1.0 fails to find...

 
 

bug #55883: Octave 5.1.0 fails to find QtOpenGL on macOS

Submitter:  None
Submitted:  Mon 11 Mar 2019 10:12:17 AM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 5.1.0
Operating System:  * Mac OS Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 23 Oct 2022 05:05:39 PM UTC, comment #15: 

No new comment since almost 2 years.
We are building Octave on macOS with GitHub runners since then. It looks like they are picking up the Qt parts correctly.

I'm going to close this as fixed (without being able to pinpoint a specific change).

If this is still an issue, the report can be re-opened.

Markus Mützel <mmuetzel>
Group administrator
Tue 01 Dec 2020 04:37:16 PM UTC, comment #14: 

There is still a reference to Qt5OpenGL here:
https://hg.savannah.gnu.org/hgweb/octave/file/51bb0e599af4/m4/acinclude.m4#l1891

We check for QOpenGLWidget here:
https://hg.savannah.gnu.org/hgweb/octave/file/51bb0e599af4/m4/acinclude.m4#l1794

Do I understand comment #10 correctly, and we no longer need to link to Qt5OpenGL now?

Markus Mützel <mmuetzel>
Group administrator
Sun 14 Apr 2019 01:09:34 AM UTC, comment #13: 

For reference, here's how I'm building the default or 5.1.0 Octave on macOS when building outside Homebrew: https://github.com/apjanke/octave-BUILD/blob/master/configure_octave.sh. (When I say "outside Homebrew", I mean that my Octave is not brewed; I'm still using a Homebrew-installed Qt and other dependencies.)

I'm adding these flags to get it to pick up Qt properly:


brew_opt="$(brew --prefix)/opt"

# Qt 5.12 compatibility hack
export QCOLLECTIONGENERATOR="qhelpgenerator"

[...]

PATH="$brew_opt/qt/bin:$PATH"

[...]

LDFLAGS="$LDFLAGS -F${brew_opt}/qt/lib"
CPPFLAGS="$CPPFLAGS -I${brew_opt}/qt/include"

[...]

PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${brew_opt}/qt/lib/pkgconfig"


This looks very similar to the `-F ...` flag that @scpeters is using.

When building Octave 5.1.0 under Homebrew, I'm using this formula: https://github.com/octave-app/homebrew-octave-app/blob/d662567fe5ce79ab9216bbf3a8aa1939aa8540e5/Formula/octave-octave-app%405.1.0.rb. It is adding `-I` and `-F` flags, even though you're not "supposed to" need those under Homebrew. I believe it (and possibly my configure script in octave-BUILD) is also relying on a hack that the Homebrew qt formula is doing: https://github.com/Homebrew/homebrew-core/blob/024e2639054c0c3ac487f433df905c96846670ec/Formula/qt.rb#L50-L58. That hack exposes the framework files and pkg-config-referenced headers in additional locations.

This whole Framework thing and the associated Homebrew hack might be why this bug is only appearing on macOS; Linux and Windows don't have Frameworks.

Andrew Janke <apjanke>
Sat 23 Mar 2019 12:55:12 AM UTC, comment #12: 

I just noticed the following patch:

https://hg.savannah.gnu.org/hgweb/octave/rev/26889

It seems like it might help?

Steve Peters <scpeters>
Fri 22 Mar 2019 06:57:49 PM UTC, comment #11: 

I believe Qt 5.12 still has QtOpenGL.framework. I think it is just having trouble finding the Frameworks. I added a `-F /usr/local/opt/qt/Frameworks` to the clang++ invocation and it seemed to fix the issue.

Steve Peters <scpeters>
Tue 12 Mar 2019 08:39:21 PM UTC, comment #10: 

Yeah I think for Octave 5.x, we don't want to make configure any more complicated than it already is. I can build Octave with Qt 5.12 with the QtOpenGL module available. Everything is configured, built, and linked properly, just that the libQt5OpenGL library is overlinked into the '__init_qt__.oct' module. That's a very minor issue and not worth fixing on stable.

This bug appears on macOS because of an unknown reason so far, is it because of a partial Qt 5.12 install? Is the QtOpenGL module removed from macOS installs now for some reason? Agree that this can be easily worked around by patching the configure script to bypass linking that module in.

For Octave 6, we can fix this bug by removing all references to QtOpenGL / Qt5OpenGL in the configuration process and only testing for and using QOpenGLWidget to vastly simplify maintenance of this going forward.

Mike Miller <mtmiller>
Group Member
Tue 12 Mar 2019 07:52:36 AM UTC, comment #9: 

Sorry, I should have checked, but I missed what you said in comment #1 and thought that QOpenGLWidget was available in all Qt 5 versions.

Given the structure of the current tests, making it conditional and not using the Qt5OpenGL module if QOpenGLWidget is available is harder and would definitely be a more disruptive change.  So I just backed out the changeset.  It builds on most systems and is only failing on systems that no longer have the Qt5OpenGL module, correct?  If so, then I'd recommend as a work around to just edit the configure script and change QT_OPENGL_MODULE as needed.

John W. Eaton <jwe>
Group administrator
Tue 12 Mar 2019 06:42:54 AM UTC, comment #8: 

jwe - I don't think this latest change is safe for the stable branch, can you revert it and we can experiment on the default branch?

In 4b256f00650c you changed the Qt 5 code to no longer look for Qt5OpenGL at all, this means version 5.1 works with Qt 5.2 but the stable branch doesn't now, that's too big of a change for stable IMHO. I did suggest in comment #3 to make it conditional on which widget is used if you think that can be done safely and without too much disruption.

Mike Miller <mtmiller>
Group Member
Tue 12 Mar 2019 06:41:54 AM UTC, comment #7: 

There is a mailing list thread if you'd like to discuss the pros and cons of dropping support for old Qt versions:

http://lists.gnu.org/archive/html/octave-maintainers/2019-03/msg00041.html

John W. Eaton <jwe>
Group administrator
Tue 12 Mar 2019 06:07:31 AM UTC, comment #6: 

I just tried http://hg.savannah.gnu.org/hgweb/octave/rev/4b256f00650c along with Qt 5.9.  It fails to find QOpenGLWidget similarly to bug #55735.  I think we need QT_OPENGL_MODULES="Qt5Widgets" instead.

Anonymous
Tue 12 Mar 2019 05:36:15 AM UTC, comment #5: 

By dropping support for Qt < 5.4, do you mean just these old versions of Qt5, or both that and Qt4?

On Slackware the latest version (14.2) ships with Qt4 only.  Users would have to find a Qt5 package or spend several hours compiling Qt5, which is fine but inconvenient.  However there's the problem of finding a Qt5 version of QScintilla (see bug #48773, Slackware ships with a Qt4 version, and I'm not aware of any package or build script for a Qt5 version) so a lot of users compile against Qt4 instead of Qt5 to get its functionality.

Anonymous
Tue 12 Mar 2019 05:18:24 AM UTC, comment #4: 

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/4b256f00650c

I'm using a separate list of modules/variables for the Qt plotting widget because it is a separate library and I don't think it needs to be linked with the QtNetwork, QtHelp, or QtXml modules.  I'm not sure how easy it would be (or if it is even possible) but I would like to be able to load the Qt plotting widget from octave-cli, similar to the way it is possible to load the FLTK plotting widget.

John W. Eaton <jwe>
Group administrator
Mon 11 Mar 2019 10:47:55 PM UTC, comment #3: 

Yeah, on the default branch I think we can safely define QT_OPENGL_{CPPFLAGS,LDFLAGS,LIBS,MODULE} to empty when building with Qt 5.4 or later. Or basically, if and only if QOpenGLWidget is used. If you want to make that change conditionally, that might be safe on the stable branch too.

But on the default branch I'd still like to hear opinions on letting go of building with anything older than Qt 5.4, and just get rid of the QT_OPENGL references altogether.

Mike Miller <mtmiller>
Group Member
Mon 11 Mar 2019 09:47:20 PM UTC, comment #2: 

Ah, I see now.  The QOpenGLWidget object is actually defined in the libQt5Widgets.so, not a separate library.  So my idea of only linking the graphics widget library with OpenGL-related things won't exactly matter...

John W. Eaton <jwe>
Group administrator
Mon 11 Mar 2019 05:01:03 PM UTC, comment #1: 

I think this confirms an observation that was just made on bug #55735, that Octave doesn't actually need Qt5OpenGL with current versions of Qt 5.

Does that module not exist in Qt 5.12 for macOS? Can you force QT_OPENGL_LIBS to empty and continue building?

@Maintainers On the development branch, is now a good time to require QOpenGLWidget (introduced in Qt 5.4) and drop the deprecated QtOpenGL / Qt5OpenGL library? (cross reference https://lists.gnu.org/archive/html/octave-maintainers/2019-03/msg00041.html)

Mike Miller <mtmiller>
Group Member
Mon 11 Mar 2019 10:12:17 AM UTC, original submission:  



Building Octave 5.1.0 on macOS 10.12, 10.13 or 10.14 fails with the following error:


ld: framework not found QtOpenGL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libgui/graphics/__init_qt__.la] Error 1


The full build output is there: https://gist.github.com/fxcoudert/de72298adc959b5bdc0a245d03a38692

We are building with:


./configure --prefix=/usr/local/Cellar/octave/5.1.0 --disable-dependency-tracking --disable-silent-rules --enable-link-all-dependencies --enable-shared --disable-static --with-hdf5-includedir=/usr/local/opt/hdf5/include --with-hdf5-libdir=/usr/local/opt/hdf5/lib --with-x=no --with-blas=-L/usr/local/opt/veclibfort/lib -lvecLibFort --with-portaudio --with-sndfile && make all


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by apjanke (Posted a comment)
  • -email is unavailable- added by scpeters (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-10-23 mmuetzel StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code