Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt 6 support (for Octave 9.x) #262

Open
3 tasks
apjanke opened this issue Feb 13, 2024 · 3 comments
Open
3 tasks

Qt 6 support (for Octave 9.x) #262

apjanke opened this issue Feb 13, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@apjanke
Copy link
Contributor

apjanke commented Feb 13, 2024

Sub-task for getting Octave 9 building with Qt6 for the 9.0 builds and the 9.1 release.

TODO

  • [in-progress] Install qt6 octave-octapp again (w/ current deps) inside a regular Homebrew install and see if that works
    • (to see if it's a conflict between octapp Homebrew and system Homebrew, like I think the error message hints at)
  • Build a qt6 octapp 9.1 on a clean build box (no system Homebrew)
    • Build clean macOS 12 and 14 Intel and AS build VMs
      • uninstalled system Homebrew on fortyhands (Intel 14)
  • Fix my dotflies to handle no-brew machines, again

References

Other references:

@apjanke apjanke self-assigned this Feb 13, 2024
@apjanke apjanke added the bug Something isn't working label Feb 13, 2024
@apjanke apjanke added this to the 9.0.0 milestone Feb 13, 2024
@apjanke
Copy link
Contributor Author

apjanke commented May 6, 2024

Last time I tried it like a week ago, my build of 9.1.0, done against Qt 6, failed during the build.

Might be due to incompatibility with Qt 6.7.0, which came out recently. There are new patches for it in the core octave formula.

I pulled those patches in (on branch "WIP/polly-olly" for now, in homebrew-octave-app repo), and the build succeeded! Looks like that was the problem.

brew install octave@9.1.0
==> Fetching octave-app/octave-app/octave@9.1.0
==> Downloading https://hg.savannah.gnu.org/hgweb/octave/raw-rev/f428a432ed4f
#=#=- #     #
==> Downloading https://hg.savannah.gnu.org/hgweb/octave/raw-rev/317fa0e5c8de
#=#=- #     #
==> Downloading https://ftp.gnu.org/gnu/octave/octave-9.1.0.tar.xz
Already downloaded: /Users/janke/Library/Caches/Homebrew/downloads/dab59124e6aa321ce174432fc262ff548a7a9a9298d347143b00276ddf2e2e0e--octave-9.1.0.tar.xz
==> Installing octave@9.1.0 from octave-app/octave-app
==> Patching
==> Applying f428a432ed4f
patching file 'm4/acinclude.m4'
==> Applying 317fa0e5c8de
patching file 'libgui/graphics/GLCanvas.cc'
==> autoreconf -f -i
==> ./configure --disable-silent-rules --enable-shared --disable-static --with-hdf5-includedir=/usr/local/opt/hdf5/include --with-hdf5-libdir=/usr/local/opt/hdf5/li
==> make all
==> make install
==> ln -sf /usr/local/Cellar/octave@9.1.0/9.1.0/bin/octave /usr/local/bin/octave@9.1.0
==> Caveats
octave@9.1.0 is keg-only, which means it was not symlinked into /usr/local,
because so it can be installed alongside regular octave.

If you need to have octave@9.1.0 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/octave@9.1.0/bin:$PATH"' >> ~/.zshrc

For compilers to find octave@9.1.0 you may need to set:
  export LDFLAGS="-L/usr/local/opt/octave@9.1.0/lib"
  export CPPFLAGS="-I/usr/local/opt/octave@9.1.0/include"

For pkg-config to find octave@9.1.0 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/octave@9.1.0/lib/pkgconfig"
==> Summary
🍺  /usr/local/Cellar/octave@9.1.0/9.1.0: 2,543 files, 63MB, built in 7 minutes 49 seconds
==> Running `brew cleanup octave@9.1.0`...
Removing: /Users/janke/Library/Caches/Homebrew/octave@9.1.0--patch--909dc65614d0ef2520c35c5f8d4f78c451b189b2673e837f4f21c18a776273f0... (671B)
Removing: /Users/janke/Library/Caches/Homebrew/octave@9.1.0--patch--a9dd08ffecff5b310039b14847e8012e150de9b71337adc0955b0e668eea1d37... (1.2KB)

Doing some more tests, and if that works, merging this to main and probably calling this fixed.

@apjanke apjanke modified the milestones: 9.0.0, 9.1.0 May 6, 2024
@apjanke
Copy link
Contributor Author

apjanke commented May 6, 2024

fxcoudert reports that the duplicate :build dep on libtool introduced by that core octave formula update was an oopsie. No actual need for a special :build dep, but I think I'll align my formulae with core just to reduce the diff output.

image

@apjanke
Copy link
Contributor Author

apjanke commented May 25, 2024

A couple weeks back, I did a 9.1 build with the qt6 variant, and it just wouldn't launch. And then a few days later, I did it again, and the build failed, maybe due to Qt 6.7 compatibility problems. I can't remember what the last state of it was. And there were GCC-related build problems with code 15.3 too. A new Xcode came out, and core Homebrew formula fixes for Qt 6.7; maybe things are fixed now.

Let's just do some more builds to establish a baseline as of 2024-05-24.

  • build 9.1 qt6 in sys Homebrew on [x] macOS 14 Intel [x] macOS 14 AS
  • build 9.1 qt6 as Octave.app on [x] macOS 14 Intel [ ] macOS 14 AS
  • try switching octave-octapp@9.1.0 dep to vanilla qscintilla2 instead of qscintilla2-octapp
  • ...and then maybe on clean build machines

Current setup on fortyhands (Intel macOS 14 VM, no system Homebrew), I've got it upgraded now, and uninstalled the system Homebrew:

Xcode 15.4
Build version 15F31d
Xcode CLT: 15.3.0.0.1.1708646388
Apple clang version 15.0.0 (clang-1500.3.9.4)

I'm doing the builds in system Homebrew on angharad and eilonwy first, for speed and convenience; that may give a positive result that the launch failure has disappeared, which would be nice. Using qscintilla2-octapp for now. Then, building Octave.app on main systems where there's already a system Homebrew with an octave-octapp@9.1.0 and current qt6 in it.

Results:

  • 9.1 w qt6 on macOS AS (eilonwy) system Homebrew: success! Launches, seems to work, test suite passes.
  • 9.1 w qt6 on macOS Intel (angharad) system Homebrew: success. Launches, seems to work, test suite passes.
  • 9.1 w qt6 on macOS Intel (angharad), Octave.app alongisde system Homebrew: breakage on launch.

For Octave.app 9.1 w/ qt5 on Intel with a an existing system Homebrew, when I double-click the app icon, it "zooms in" but nothing else happens. When launching it from the command line, I get this error:

[usr] $ hostname
angharad.local
[usr] $ date
Sat May 25 08:04:32 EDT 2024
[usr] $ ./bin/octave-octapp\@9.1.0
objc[34966]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x10a498608) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x108149608). One of the two will be used. Which one is undefined.
objc[34966]: Class KeyValueObserver is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x10a498630) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x108149630). One of the two will be used. Which one is undefined.
objc[34966]: Class RunLoopModeTracker is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x10a498680) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x108149680). One of the two will be used. Which one is undefined.
objc[34966]: Class QDarwinPermissionHandler is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x10a4986f8) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x1081496f8). One of the two will be used. Which one is undefined.
objc[34966]: Class QCocoaPageLayoutDelegate is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtPrintSupport.framework/Versions/A/QtPrintSupport (0x107669270) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtPrintSupport.framework/Versions/A/QtPrintSupport (0x1047af270). One of the two will be used. Which one is undefined.
objc[34966]: Class QCocoaPrintPanelDelegate is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtPrintSupport.framework/Versions/A/QtPrintSupport (0x1076692e8) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtPrintSupport.framework/Versions/A/QtPrintSupport (0x1047af2e8). One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x600003be0140) is not the object's thread (0x600003bfe010).
Cannot move to target thread (0x600003be0140)

You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: offscreen, minimal, cocoa.

Abort trap: 6
[usr] $

That's straight up talking about libs from both the system Homebrew and Octave.app Homebrew.

objc[34966]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x10a498608) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x108149608). One of the two will be used. Which one is undefined.

So how is the system Homebrew one getting pulled in? Is it linked at build time, directly or indirectly? Or do I have some run time directive that pulls in the system Homebrew one? The latter seems unlikely, especially in the case of a GUI launch from Finder. And I don't have $LD_LIBRARY_PATH or $LD_PRELOAD set.

[usr] $ env | grep LD
[usr] $

At least the error message has a hint:

You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.

So...

[usr] $ DYLD_PRINT_LIBRARIES=1 ./bin/octave-octapp\@9.1.0
dyld[35037]: <797DF44C-F5A5-3087-8990-2CABD9887C7F> /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/octave-octapp@9.1.0/9.1.0/bin/octave-9.1.0
dyld[35037]: <7CC1B88C-75CF-3F2C-BA62-C6F0652A150D> /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/readline/8.2.10/lib/libreadline.8.2.dylib
dyld[35037]: <9698C163-C407-3986-B69D-E487C8713FC4> /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/sundials/7.0.0/lib/libsundials_ida.7.0.0.dylib
[...]
dyld[35037]: <86757E83-1665-3A55-99E8-D7D62EF93986> /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/graphite2/1.3.14/lib/libgraphite2.3.2.1.dylib
dyld[35037]: <ADB10020-9917-3A57-9DCF-8A949A7F1A1F> /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtSql.framework/Versions/A/QtSql
dyld[35037]: <C545F75A-E591-3791-94FB-0FC3325F1BD5> /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/brotli/1.1.0/lib/libbrotlidec.1.1.0.dylib
dyld[35037]: <47952E32-BB26-3CD7-9293-65BFCA3F66D1> /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/brotli/1.1.0/lib/libbrotlicommon.1.1.0.dylib
dyld[35037]: <13544B5D-2303-377C-A098-BB9DFF251E40> /usr/local/Cellar/qt/6.7.0_1/lib/QtPrintSupport.framework/Versions/A/QtPrintSupport
dyld[35037]: <B24F7EE5-3E8B-3F4D-8334-0078290C265A> /usr/local/Cellar/qt/6.7.0_1/lib/QtWidgets.framework/Versions/A/QtWidgets
dyld[35037]: <0D74653E-184D-34B4-A10C-2CFA621C334F> /usr/local/Cellar/qt/6.7.0_1/lib/QtGui.framework/Versions/A/QtGui
dyld[35037]: <A78169A1-6B64-33C2-A157-AEA085F7A49A> /usr/local/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore
dyld[35037]: <EAC05EF3-133A-3034-8945-6939E9C7E4E0> /usr/local/Cellar/glib/2.80.2/lib/libglib-2.0.0.dylib
dyld[35037]: <CB40F6F0-8274-3015-A3A5-BB1C4D63E84E> /usr/local/Cellar/qt/6.7.0_1/lib/QtDBus.framework/Versions/A/QtDBus
dyld[35037]: <A7CE725B-8C2F-31A7-881E-3849519BE95C> /usr/local/Cellar/libpng/1.6.43/lib/libpng16.16.dylib
dyld[35037]: <CD3FC454-4C6D-38DE-904E-B105A6499B06> /usr/local/Cellar/harfbuzz/8.4.0/lib/libharfbuzz.0.dylib
dyld[35037]: <A4DED5C8-85B6-33CA-AE2A-3D076F16AA4E> /usr/local/Cellar/md4c/0.5.2/lib/libmd4c.0.5.2.dylib
dyld[35037]: <D52F652A-74D6-313C-84A1-11D8B65153CE> /usr/local/Cellar/freetype/2.13.2/lib/libfreetype.6.dylib
dyld[35037]: <302CA87E-DE76-3F2D-9F1E-66ADEF9DC134> /usr/local/Cellar/glib/2.80.2/lib/libgthread-2.0.0.dylib
dyld[35037]: <DE029F22-11DA-36D8-A0E6-050AF177861C> /usr/local/Cellar/gettext/0.22.5/lib/libintl.8.dylib
dyld[35037]: <E1CEB0C5-E4DC-3DB5-B834-F629DC22169F> /usr/local/Cellar/pcre2/10.43/lib/libpcre2-8.0.dylib
dyld[35037]: <F557D50F-86C7-3C72-9CEB-429DE3055D54> /usr/local/Cellar/dbus/1.14.10/lib/libdbus-1.3.dylib
dyld[35037]: <DA4EE5CE-C735-3399-AE24-02100C59DF8B> /usr/local/Cellar/icu4c/74.2/lib/libicui18n.74.2.dylib
dyld[35037]: <EF56A072-52EE-31F4-B151-5A0BDA67385C> /usr/local/Cellar/icu4c/74.2/lib/libicuuc.74.2.dylib
dyld[35037]: <E76E88B0-50CD-30D0-9AEB-E8A04EB4E1E9> /usr/local/Cellar/icu4c/74.2/lib/libicudata.74.2.dylib
dyld[35037]: <F85E32EE-1AB9-3731-8BB6-EEA3191ECD8C> /usr/local/Cellar/double-conversion/3.3.0/lib/libdouble-conversion.3.3.0.dylib
dyld[35037]: <2FEAB7B3-BFFE-35D0-BBB8-54D37ABB00C7> /usr/local/Cellar/libb2/0.98.1/lib/libb2.1.dylib
dyld[35037]: <879EFFC1-E4C6-387E-B8AF-57B45C225878> /usr/local/Cellar/pcre2/10.43/lib/libpcre2-16.0.dylib
dyld[35037]: <2BC8492D-2343-3F75-BFB5-653FB78584F9> /usr/local/Cellar/zstd/1.5.6/lib/libzstd.1.5.6.dylib
dyld[35037]: <86757E83-1665-3A55-99E8-D7D62EF93986> /usr/local/Cellar/graphite2/1.3.14/lib/libgraphite2.3.2.1.dylib
objc[35037]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /usr/local/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x107c98608) and /Applications/Octave-9.1.0_beta2.app/Contents/Resources/usr/Cellar/qt/6.7.0_1/lib/QtCore.framework/Versions/A/QtCore (0x105949608). One of the two will be used. Which one is undefined.

That's the first time I see the /usr/local/ system Homebrew location show up. Dunno if that means that brotli is linked that way, or if there's a stack popping or tree relationship that I can't see here, and it's a previous library that's linked to both brotli and the system Homebrew Qt. Brotli is a small compression library, and its Homebrew formula depends only on cmake, so I kinda doubt it links to qt.

Maybe this could be diagnosed by dumping the DLL linkage for binaries in the Octave.app build, using otool or something like that? Been a while since I've done that, and I don't remember how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant