Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Recommended way to deploy/install Qt6 shared libraries

Recommended way to deploy/install Qt6 shared libraries

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
16 Posts 3 Posters 4.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    Hi guys, I have a development machine with Ubuntu 20.04 x64 and a target machine with Ubuntu Server (no GUI) 20.04 x64.
    Which is the best way to install or deploy the shared libraries to the target machine?
    Of course there are several options:

    • build from source on the target itself
    • copy the libraries from ~/Qt/6.2.0/gcc_64/lib/

    But I wonder if there's a tool to make this process reliable and easier. For example, like the online installer but with no GUI (I didn't find a command line version for it). Or even just a tar.gz containing the shared libraries compiled for the most common architectures (x86/x64/arm, ecc...).

    Or even a function inside QtCreator to deploy the required libraries during the deployment steps (of course without manually selecting one by one...).

    jsulmJ 1 Reply Last reply
    0
    • M Mark81

      Hi guys, I have a development machine with Ubuntu 20.04 x64 and a target machine with Ubuntu Server (no GUI) 20.04 x64.
      Which is the best way to install or deploy the shared libraries to the target machine?
      Of course there are several options:

      • build from source on the target itself
      • copy the libraries from ~/Qt/6.2.0/gcc_64/lib/

      But I wonder if there's a tool to make this process reliable and easier. For example, like the online installer but with no GUI (I didn't find a command line version for it). Or even just a tar.gz containing the shared libraries compiled for the most common architectures (x86/x64/arm, ecc...).

      Or even a function inside QtCreator to deploy the required libraries during the deployment steps (of course without manually selecting one by one...).

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Mark81 said in Recommended way to deploy/install Qt6 shared libraries:

      But I wonder if there's a tool to make this process reliable and easier

      There is an unofficial tool: https://github.com/probonopd/linuxdeployqt

      https://doc.qt.io/qt-5/linux-deployment.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Mark81 said in Recommended way to deploy/install Qt6 shared libraries:

        But I wonder if there's a tool to make this process reliable and easier

        There is an unofficial tool: https://github.com/probonopd/linuxdeployqt

        https://doc.qt.io/qt-5/linux-deployment.html

        M Offline
        M Offline
        Mark81
        wrote on last edited by
        #3

        @jsulm Unfortunately it does not work with Ubuntu 20.04 (just tried):

        https://github.com/probonopd/linuxdeployqt/issues/466

        jsulmJ 1 Reply Last reply
        0
        • M Mark81

          @jsulm Unfortunately it does not work with Ubuntu 20.04 (just tried):

          https://github.com/probonopd/linuxdeployqt/issues/466

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Mark81 There is a flag you can pass when calling the tool to overrule the "too new glibc" error.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          M artwawA 2 Replies Last reply
          0
          • jsulmJ jsulm

            @Mark81 There is a flag you can pass when calling the tool to overrule the "too new glibc" error.

            M Offline
            M Offline
            Mark81
            wrote on last edited by
            #5

            @jsulm I'm going to search for that flag. But, correct me if I'm wrong, this would just copy the required files, right? I mean, it does not take care of installing egl support or other libraries I may need on the target I guess.

            jsulmJ 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Mark81 There is a flag you can pass when calling the tool to overrule the "too new glibc" error.

              artwawA Offline
              artwawA Offline
              artwaw
              wrote on last edited by
              #6

              @jsulm I tried that recently in a feat to deploy one of my tools for my coworkers using linux - that flag doesn't do much good, the tool doesn't work correctly with that setting. That is also mentioned by the author somewhere in the linked thread...
              I tried various other things but ended up installing Qt 5.12.8 that is provided by Ubuntu and wrapping up dependencies to be pulled by apt as native packages.
              Might be that I tried something wrong but I used ldd and friends to sort out dependencies - the first level ones were easy to find but then there come plugins and their dependencies that also need to be provided (some of them are not binary compatible with the ones provided by Ubuntu which I discovered the hard way) and it's just too much work I think.

              For more information please re-read.

              Kind Regards,
              Artur

              1 Reply Last reply
              1
              • M Mark81

                @jsulm I'm going to search for that flag. But, correct me if I'm wrong, this would just copy the required files, right? I mean, it does not take care of installing egl support or other libraries I may need on the target I guess.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Mark81 said in Recommended way to deploy/install Qt6 shared libraries:

                this would just copy the required files, right?

                Yes.
                The thing with Linux is that there are many different distributions, in different versions with different package managers. So, there is no "one fits all" solution for Linux. For example: for Debian based Distributions you would create a Debian (deb) package where you also define the dependencies and where to install what. For RedHat/Fedora based distributions you would create a RPM package.
                Since you want to support Ubuntu 20.04 you should take a look at how to create Debian packages.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @Mark81 said in Recommended way to deploy/install Qt6 shared libraries:

                  this would just copy the required files, right?

                  Yes.
                  The thing with Linux is that there are many different distributions, in different versions with different package managers. So, there is no "one fits all" solution for Linux. For example: for Debian based Distributions you would create a Debian (deb) package where you also define the dependencies and where to install what. For RedHat/Fedora based distributions you would create a RPM package.
                  Since you want to support Ubuntu 20.04 you should take a look at how to create Debian packages.

                  M Offline
                  M Offline
                  Mark81
                  wrote on last edited by
                  #8

                  @jsulm I understand that, but why there is no way to invoke the Qt Installer from command line? I works perfectly on a Desktop environment... so it can also download and build the selected modules in a server environment.

                  Building from sources requires several GB of spaces, tons of packages, lot of hours and headaches for something that the installer does every time with no pain...

                  jsulmJ 1 Reply Last reply
                  0
                  • M Mark81

                    @jsulm I understand that, but why there is no way to invoke the Qt Installer from command line? I works perfectly on a Desktop environment... so it can also download and build the selected modules in a server environment.

                    Building from sources requires several GB of spaces, tons of packages, lot of hours and headaches for something that the installer does every time with no pain...

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Mark81 Why do you need to build anything on the target machine?
                    Why not build your app on the developer machine, create installer or Debian package and distribute it then?

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    M 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Mark81 Why do you need to build anything on the target machine?
                      Why not build your app on the developer machine, create installer or Debian package and distribute it then?

                      M Offline
                      M Offline
                      Mark81
                      wrote on last edited by Mark81
                      #10

                      @jsulm Because as I said the target machine does not run the X server. So when developing I need to debug the remote application while it runs with eglfs. Furthermore in this project the screen is vertical, so it would be very tricky to develop locally...

                      Another example: for another project (always with Ubuntu Server 20.04) the target machine is connected to the field (Modbus, OPC-UA and Ethernet). I can't really debug the console application locally, I have to run and debug it on the target otherwise I cannot receive the data from the field.

                      jsulmJ 1 Reply Last reply
                      0
                      • M Mark81

                        @jsulm Because as I said the target machine does not run the X server. So when developing I need to debug the remote application while it runs with eglfs. Furthermore in this project the screen is vertical, so it would be very tricky to develop locally...

                        Another example: for another project (always with Ubuntu Server 20.04) the target machine is connected to the field (Modbus, OPC-UA and Ethernet). I can't really debug the console application locally, I have to run and debug it on the target otherwise I cannot receive the data from the field.

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @Mark81 You don't have to build on target machine to do remote debugging. Build on your developer machine, copy the binary to the target machine and debug remotely.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        M 1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @Mark81 You don't have to build on target machine to do remote debugging. Build on your developer machine, copy the binary to the target machine and debug remotely.

                          M Offline
                          M Offline
                          Mark81
                          wrote on last edited by
                          #12

                          @jsulm the problem is it does not deploy the libraries! And without the libraries of course it cannot run.
                          I meant build the Qt6 libraries, not my application.

                          jsulmJ 1 Reply Last reply
                          0
                          • M Mark81

                            @jsulm the problem is it does not deploy the libraries! And without the libraries of course it cannot run.
                            I meant build the Qt6 libraries, not my application.

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by jsulm
                            #13

                            @Mark81 Simply deploy the libraries once from host to the target...

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            M 1 Reply Last reply
                            0
                            • jsulmJ jsulm

                              @Mark81 Simply deploy the libraries once from host to the target...

                              M Offline
                              M Offline
                              Mark81
                              wrote on last edited by
                              #14

                              @jsulm I wrote this suggestion in my own question :-)
                              But it does work for console application only.

                              I guess it is because the libraries on the dev machines are built (from the online installed) against x11, while the target machine requires eglfs. I tried to explore the online installer items but I didn't find anything that allows me to select eglfs. I guess it detects the platform automatically when it runs. From here the request to run it without X.

                              jsulmJ 1 Reply Last reply
                              0
                              • M Mark81

                                @jsulm I wrote this suggestion in my own question :-)
                                But it does work for console application only.

                                I guess it is because the libraries on the dev machines are built (from the online installed) against x11, while the target machine requires eglfs. I tried to explore the online installer items but I didn't find anything that allows me to select eglfs. I guess it detects the platform automatically when it runs. From here the request to run it without X.

                                jsulmJ Offline
                                jsulmJ Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                @Mark81 said in Recommended way to deploy/install Qt6 shared libraries:

                                But it does work for console application only.

                                It should work if you also deploy eglfs platform plug-in.

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                M 1 Reply Last reply
                                0
                                • jsulmJ jsulm

                                  @Mark81 said in Recommended way to deploy/install Qt6 shared libraries:

                                  But it does work for console application only.

                                  It should work if you also deploy eglfs platform plug-in.

                                  M Offline
                                  M Offline
                                  Mark81
                                  wrote on last edited by Mark81
                                  #16

                                  @jsulm so far I tried to build a simple QtWidget "Hello world" application on my dev machine.
                                  Then I copied it to the target with this structure:

                                  $ tree
                                  .
                                  ├── test_qt6
                                  │   └── bin
                                  │   ├── test_qt6
                                  │   └── platforms
                                  │   └── libqeglfs.so
                                  ├── qt6_libs
                                  │ ├── libicudata.so
                                  │ ├── libicudata.so.56
                                  │ ├──libicudata.so.56.1
                                  │ ├──libicui18n.so
                                  │ ├──libicui18n.so.56
                                  │ ├──libicui18n.so.56.1
                                  │ ├──

                                  but running the application with:

                                  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/qt6_libs /home/user/test_qt6/bin/./test_qt6 -platform eglfs
                                  

                                  it still searches for x11:

                                  ./test_qt6: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory

                                  ps. sorry but the editor loses the indentation. The platform plugin file is actually inside the platforms directory

                                  UPDATE

                                  I tried to copy the missing library, now ldd finds all.
                                  But still does not run:

                                  EGLFS: Failed to open /dev/fb0
                                  EGLFS: Can't continue without a display

                                  I'm working to check the permissions.... fixed.

                                  $ export QT_QPA_PLATFORM=eglfs
                                  $ export QT_QPA_EGLFS_FB=/dev/fb0
                                  $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/qt6_libs ./test_qt6 -platform eglfs
                                  Could not initialize egl display
                                  Aborted (core dumped)
                                  
                                  1 Reply Last reply
                                  0

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved