Recent

Author Topic: Ubuntu 19.10 and libgdk  (Read 12224 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #30 on: November 10, 2019, 01:16:29 am »
Thanks for that Zeljko !

2. http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html is talking about Qt4 version of bidings. They aren't changed for years and won't be changed.
3. Qt5 bindings are not at the third party site they're located in lcl/interfaces/qt5/cbindings so you can build it at any time.

OK, so there is the problem.  Ubuntu are currently shipping what they call 2.6beta for Qt5 apparently from that site. That site does have a 2.6Alpha for Qt5. They have been shipping exactly the same version with, at least, 18.04 through to 19.10. Should we ask them to follow the version in the Lazarus tree ?  What they ship now does, apparently work with the version of Qt5 they ship.


4.......for linux (if OS does not have libQt5Pas or it's outdated), put eg lib/ directory inside your app directory and copy there your libQt5Pas, then under linker options in your project add additional rpath to linker and everything will work w/o problems.
Hmm, in Linux the binary should end up in, eg /usr/local/bin  I really don't like the idea of creating a new directory off there containing an extra library, that would be pretty much in breech of the Linux standards. I think ~/.local/lib would be a better place to put it on a singer user system. But if this 2.6beta works on U19.10 it should work on U18.04, I'll look a bit closer....

As to the version of Qt itself, it looks to me as if its only a problem with Ubuntu's long term release kit. Even Debian 9.9 ships Qt 5.7. On U19.10 they have Qt 5.12 and I guess the next long term release (next April) will be similar. So, maybe the problem I am worrying about will go away over time ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ubuntu 19.10 and libgdk
« Reply #31 on: November 10, 2019, 11:03:41 am »
I don't know how Ubuntu packagers call libQt5Pas package, I just know that libQt5Pas under Ubuntu 19.10 is correct and everything works out of the box (lclqt5).
For rpath paths, of course you can add any path you want, I've just written simple example about rpath.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #32 on: November 11, 2019, 09:20:51 am »
Yeah, I am not sure where they get it from but clearly not the website the package manager points to !

The naming thing, I sort of understand. You talk about version 1.2.7 and Ubuntu has libqt5pas1.2.6, the '1' being tacked on to its name ?  Seems pretty sure the '2.6' corresponds to your '2.7' so they are only a step behind.

I have started docing what I have found about Qt5 on https://wiki.lazarus.freepascal.org/Qt5_Interface#Linux

Real stand out is the dependencies of a Qt5 app is one tenth that of a GT2 if your distro has neither.  And its pretty plain that more and more are going to start leaving out GTK2. I'll be releasing a Qt5 version of my app as soon as I have run it through my standard tests.

As usual Zelijko, thanks for your help !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ubuntu 19.10 and libgdk
« Reply #33 on: November 11, 2019, 09:31:09 am »
@dbannon, about version - I'm reffering about version I've changed in Qt5Pas.pro (lcl/interfaces/qt5/cbindings/Qt5Pas.pro). Version is changed due to new routines eg QLineEdit_placeholderText() and changed winId to be PtrUInt instead of PtrInt.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ubuntu 19.10 and libgdk
« Reply #34 on: November 11, 2019, 09:35:27 am »
I've also added few comments on  https://wiki.lazarus.freepascal.org/Qt5_Interface#Linux.
Qt5-5.6.0 is minimum version which can be used with libQt5Pas. libQt5Pas built against Qt5-5.6.x can work with
any Qt5 version > 5.6 and is fully compatibile.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #35 on: November 12, 2019, 01:45:25 am »
And I have been back to that wki page too.   

Most newer distros seem OK using their own repo versions of Qt5 and libqt5pas except for Ubuntu 16.04 (good to at least 2021) and Ubuntu18.04 (good until 2023). They have the same version number on their libqt5pas but it does not work as it should ! 

They have some serious version control problems !

You cannot replace it with a libqt5pas from a later Ubuntu because it has a test to see what version of Qt5 its using.
However, the library built using the code from Lazarus tree does not have such as test and it can be pushed onto ether 16.04 or 18.04 and every thing works fine.
Quite a grotty situation for someone sending out linux binaries .....

Best you keep an eye on that wiki page, I will add to it from time to time and you may well spot some terrible mistake !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: Ubuntu 19.10 and libgdk
« Reply #36 on: November 20, 2019, 06:52:52 pm »
I did a clean install of Ubuntu 19.10 on a new computer. Since GTK2 was not installed, I needed to install it:
  sudo apt-get install libgtk2.0-0
after this, the Lazarus programs launch, but only after a ~20 second delay. Once the GTK program is running, all is fine. But ANY Lazarus GTK2 app takes a long time to start - regardless of whether it is the large IDE or a small application.

Fortunately, Ubuntu 19.04 seems to ship with an intact copy of libqt5 (unlike 18.04 where one needs to rebuild bindings), so one can simply install
  sudo apt-get install libqt5pas-dev
The IDE and all my programs nicely compile to QT5. Very impressive.

One final issue, when you recompile the Lazarus IDE, if regenerates the "Lazarus" executable but not the "startlazarus" executable. If I look at the recompiled "Lazarus" it uses QT5, but the "startlazarus" remains gtk2. If I launch Lazarus with "startlazarus" I get the long delay before it calls "Lazarus" while if I run "Lazarus" it launches immediately. Does anyone have any idea why GTK2 applications on Ubuntu 19.04 have this long delay, and if there is any way to eliminate the delay?

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #37 on: November 21, 2019, 12:16:52 pm »

Chris, "I think" if you have built your own Lazarus in your own home directory, then you don't need to use startlazarus.  Again, "I think" that startlazarus is only useful if Lazarus has been installed up in /usr/ somewhere and you cannot write to it there. When you come to rebuild Lazarus (eg when installing a package) it does all sorts of clever tricks, hiding the newly built version of lazarus down in your disk area in the lazarus dot config directory.

I never use startlazarus, always start one of several versions I have just using a script that cd's to the appropriate lazarus subdirectory and calls 'lazarus' passing it an option to make it use the matching config dir.

for example, in my $HOME/bin directory is start-laz-fixes :

Code: [Select]
#!/bin/bash
RELEASE="fixes_2_0"
cd /home/dbannon/bin/Lazarus/"$RELEASE"
./lazarus --PCP=/home/dbannon/.Laz_"$RELEASE"

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: Ubuntu 19.10 and libgdk
« Reply #38 on: November 21, 2019, 02:38:33 pm »
@dbannon thanks for your comments. Yes, once Lazarus is built to QT, there is no need to use the GTK2 startlazarus. What really puzzles me is why every single GTK2 app compiled by Lazarus pauses for around 20 seconds when launching. This influences all my projects (MRIcroGL, Surfice, etc), most other Lazarus projects (as GTK2 is still the default widgetset) and the default installation of Lazarus. Most non-developers or new Lazarus users will be frustrated by this startup issue. I do not know if Lazarus is trying to check screen resolution, fonts, or something else, but on a clean install of 19.10 the startup times of GTK2-based Lazarus applications is unacceptable, and I would be grateful to anyone who can find a solution. 

mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Re: Ubuntu 19.10 and libgdk
« Reply #39 on: November 21, 2019, 05:14:14 pm »
I have no such problem on any Ubuntu version pausing GTK2 app. ;)

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: Ubuntu 19.10 and libgdk
« Reply #40 on: November 21, 2019, 06:59:19 pm »
I have the pause issue with every Lazarus built GTK2 including Lazarus as initially installed and every Lazarus project including "Hello world". I inserted written statements, and the pause appears to occur after the FormShow and FormCreate events. It is a standard Ubuntu 19.04 install on a new machine (Ryzen 3900X, Nvidia 2080 Ti setup for CUDA). The entire interface pauses during this period - I can not interact with other programs.

mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Re: Ubuntu 19.10 and libgdk
« Reply #41 on: November 21, 2019, 07:40:12 pm »
It is working great in virtualbox and and also on diffrent hw intel/amd...no pause, no nothing.
I always use the proprietary driver for nvidia on x...
Have you tried a diffrent binary made with Lazarus on your machine? Same problem?
You can try my video converter and see if the problem replicates..
http://dmsimpleapps.blogspot.com/2014/04/dmmediaconverter.html

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: Ubuntu 19.10 and libgdk
« Reply #42 on: November 21, 2019, 08:00:30 pm »
Just installed Ubuntu 19.10 as a clean install on a new machine (Intel 4790, Nvidia 970 but have not yet installed Nvidia drivers). The behavior is the the same. The default Lazuar built to GTK2 and hello world built to GTK2 also stall the system on Launch. Again, Lazarus applications built to QT5 seem fine. Did you do a clean install of Ubuntu, or did you upgrade from an early version of Ubuntu or install a variant like Ubuntu?

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: Ubuntu 19.10 and libgdk
« Reply #43 on: November 21, 2019, 09:36:23 pm »
@mdalacu I installed dmMediaConverter - v2.3.1 directly from the amd64 deb file you linked to. On both my AMD Ryzen and Intel i7 the software paused for 26 seconds between starting from the command line and appearing on screen. For both hardware systems, Ubuntu 19.10 was installed clean on an empty hard drive. The Ubuntu installer was downloaded direct from the Ubuntu web site. I ensured all packages were up to date. It seems that all Lazarus programs compiled for GTK2 incur a long penalty for loading on Ubuntu 19.10. Any insights appreciated.

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: Ubuntu 19.10 and libgdk
« Reply #44 on: November 21, 2019, 09:53:09 pm »

Building a Lazarus GTK hello world project with "Dwarf with sets" set in the debug suggests that FormCreate and FormShow are called before the pause. However, text on labels does not appear until after the pause. The following errors were exported to the command line.

(project1:14196): Gdk-CRITICAL **: 15:49:14.898: IA__gdk_window_get_events: assertion 'GDK_IS_WINDOW (window)' failed

(project1:14196): GLib-GObject-CRITICAL **: 15:49:14.898: g_object_ref: assertion 'G_IS_OBJECT (object)' failed

(project1:14196): GLib-GObject-CRITICAL **: 15:49:14.898: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

 

TinyPortal © 2005-2018