Qt World Summit: Register Today!

After compiling QT5, reduce to the minimum its size for installations in other machines

  • Hello everyone,
    I needed a concrete Qt5 version (5.6.2) for a 32 bits platform, so I had to compile Qt5 following the steps advised in: https://wiki.qt.io/Building_Qt_5_from_Git

    Well, once I got Qt5 compiled I tested that after using make install everything was installed in where I expected. The problem is that I pretend to install this in other computers and I cannot compile Qt5 in each of them. So I thought the best way to do this could be to remove all unnecessary data (.o??, what else can I remove?) and tar.gz the folder. With this I could just unzip the file, ./configure (in order to generate the customized MakeFile) and make install in the other machine. This has been one of my first thoughts but surely this has to be a better way because I do not even know if this would work....
    I would like to have as result something with the same size (more or less) that the resultant installed Qt5 after installing it with make install (more than 6GB compiled and 285MB installed in the folder selected by using -prefix).

    Any advice will be really appreciated.

    Best regards,


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you thinking about what is needed to deploy your application ? Or for development ?

  • Hello!!!
    Well, I need to provide with Qt5 libs to a our framework (a configurable Qt application), so once I have compiled Qt5, I think that correctly because no error promted and I was able to execute several examples (I executed some related to threads just for testing something), but I need to know if in order to "install" this compiled Qt5 version in other device I would just need to copy the qt5 folder to /usr/local/lib or what (the prefix used in ./configure was /usr/local/lib/qt5).

    Best regards and thanks for your patience,


  • Lifetime Qt Champion

    @Ivan-Gomez What device is it? Is your Qt built for this device?

  • @jsulm Hello. It is an i386 with Ubuntu Server 32bits. It ran a Qt4 (installed with apt) but now we need a concrete version of Qt5 (5.6.2) in order to grant the compatibility with another device with that version preinstalled, but please leave this last device with the preinstalled Qt5 apart from the discussion. I have compiled Qt5 (5.6.2) natively for the device and I have "tested" it is working fine executing the examples included in Thread folder (qtbase I think they are located).
    Thanks in advance.


  • @Ivan-Gomez
    There are many unanswered questions. For a start, are we to assume that the various servers are identical before you fetch & compile Qt on one of them, or does the development one have a potentially-different configuration?

    You're really supposed to look at, say, https://github.com/probonopd/linuxdeployqt for how to deploy to other machines.

    It does matter what your assumptions are about the target machines compared to the source machine, if you're trying to shortcut stuff.

  • @JonB Hello. The Qt5 will run un identical devices with identical OS, just one to know what I need to do to install that Qt5 compilation output in other identical machines: copy the folder from one /usr/local/lib to the other's machine /usr/local/lib would be enough. I am going to check the link you attached to your answer, thanks!.


  • @Ivan-Gomez
    I didn't just mean " identical devices with identical OS", I meant what about absolutely identical set up (i.e. same other software packages already installed identically)? In effect, are you saying the machines are identical clones, just prior to wanting to install the Qt stuff, or could they have differences?

    Just as an example, perhaps your Qt app requires MySQL Server. Has this already been installed on the other machines, or only on your development one?

    The link for linuxdeployqt is the way other Linux Qt developers deploy their apps to other machines, but it is a complete app itself, very different from simply copying some files to /usr/local/lib.

  • @JonB Hello!. The machines are exaclty identical. Finally I got the machines run perfectly with Qt4 and Qt5 (5.6.2 compiled for 32bits). I am going to perfom some tests and let's see if everything keeps working as it is expected to.

    Thanks you for your advices,


Log in to reply