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. Qt Application Linux Deployment
Forum Updated to NodeBB v4.3 + New Features

Qt Application Linux Deployment

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 4 Posters 7.0k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    JPNaude
    wrote on last edited by
    #1

    Hi

    I know that this is an issue with numerous posts related to it. However in none of those posts I could find a proper "best practice" way to deploy an application on Linux.

    I've struggled for many hours with this, up to the point where the last remaining issues are only related to the required dependencies which needs to be distributed with the application.

    This is what I do:

    • Build Qt 4.8.4 on the target 64 bit platforms (I've tried both Fedora 18, CentOs 6.5 and Ubuntu 10.04).
    • Build the application against my custom built Qt version.
    • I then have a script that does the following (based on the "Qt deployment guidelines":http://qt-project.org/doc/qt-4.8/deployment-x11.html):

    It runs ldd on my application as well as all my plugins. The script copies all found dependencies into a /install_version/libs directory.

    It also runs ldd on the required Qt libs in order for all their dependencies to copied to the libs directory as well.

    The script then removes the RPATH from the Qt libs.

    The script creates a launch.sh file for the application which sets the LD_LIBRARY_PATH as described in the "deployment guidelines":http://qt-project.org/doc/qt-4.8/deployment-x11.html in the Qt documentation.

    Finally, the script packages everything using makeself

    When I install my packages on the same machine it works as expected. However when I install the package on a newer version of the OS it does not work. For example, the package I built on Ubuntu 10.04 crashes with seg faults on Ubuntu 12.04. Interestingly enough, I found that if I remove everything from the /libs folder except the Qt libs and my own libs, the install works 100% on Ubuntu 12.04. I assume that this is a fluke because the Qt dependencies which are present on the 12.04 install is binary compatible with that of 10.04. However this package will break as soon as one of the dependencies are not binary compatible any more...

    Thus, my question is this:
    Which dependencies are required in the /libs folder? Or is there a better way to do this (apart from RPM and DEB packages)?

    I checked the Qt Creator installation for example, in there they also have the minimum number of libs in there (they don't distribute libgc for example...)

    Any feedback on this topic would be much appreciated.
    Thanks
    Jaco

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goblincoding
      wrote on last edited by
      #2

      Hi JP,

      I'm currently battling with the exact same issue, so unfortunately have nothing to offer (but I'd like to see what others are saying).

      I could just have subscribed to this thread, but have to ask, are you a South African? Not many of us around here as far as I know :)

      http://www.goblincoding.com

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JPNaude
        wrote on last edited by
        #3

        Hi

        Yes, I'm from Pretoria. Cool, have checked out your blog in the past, did not realize you're from SA as well.

        Anyway, have you had any luck with this deployment issue?

        Cheers
        Jaco

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goblincoding
          wrote on last edited by
          #4

          Unfortunately not, been very busy with other things (it's another pet project I'm working on so not a priority). Hopefully someone with more experience will come along soon, but from what I've seen, it seems like this is pretty much what *nix deployment is like: a mission.

          http://www.goblincoding.com

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goblincoding
            wrote on last edited by
            #5

            Hi Jaco,

            I'm still battling and want to ask you if you'd mind terribly sharing your script (the one mentioned in your first post)?

            If you'd prefer not sharing it out in the open, we can make a plan (if you prefer not to, it's also OK, I just thougth I'd ask :) )

            Seems there really isn't an easy way to go around Linux deployments...

            http://www.goblincoding.com

            1 Reply Last reply
            0
            • J Offline
              J Offline
              JPNaude
              wrote on last edited by
              #6

              Hi

              Apologies for my long response time. The script is quite specific and not commented well. I'd be happy to share it offline. Let me know if you still interested.

              Cheers
              Jaco

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goblincoding
                wrote on last edited by
                #7

                Yes, for sure...any ideas are welcome :)

                PM'ed you my email address.

                Have an excellent weekend!

                http://www.goblincoding.com

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  peanutstars
                  wrote on last edited by
                  #8

                  If not solved, Please refer to http://blog.naver.com/hseok74/120193947673 .

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    ambershark
                    wrote on last edited by
                    #9

                    I haven't had a whole lot of trouble with Linux releases. I use Gentoo for reference but it shouldn't matter.

                    Try the following:

                    1. Install the package as usual on a target machine where it is not working
                    2. Open a bash shell and "export LD_LIBRARY_PATH="/your/path/to/libs"
                      That means the path to your install ./libs directory based on what I read above.
                    3. run ldd ./yourapp

                    Check the output and see which libraries it is trying to use. If you see things like /usr/lib64/xxx that is probably not what you intended since you are trying for a self-contained application with all it's dependencies in the app directory itself.

                    I can try to help further if you post the resulting ldd output.

                    edit: you can also do the following instead of exporting ld_library_path:

                    bash$ LD_LIBRARY_PATH="/your/path/to/libs" ./yourapp

                    I think exporting it would be better for testing purposes though not something you would want to do to an end user's system. :)

                    My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                    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