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. Building qmake: Reducing Application File Size
Forum Updated to NodeBB v4.3 + New Features

Building qmake: Reducing Application File Size

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 3 Posters 610 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
    J_Kolonis
    wrote on 4 Jun 2021, 16:29 last edited by J_Kolonis 6 Apr 2021, 16:29
    #1

    Hello,

    I am developing a QtQuick Application with C++ backend that is targeting an embedded linux device using a STM32MP157 MPU. Upon production release, I'm limited to upgrading my application via a UART file transfer, so I want to reduce my application file size as much as possible.

    I am currently developing on a Windows 10 Host using a VirtualBox Ubuntu 18.04 Guest VM. I built qmake for my target from source to target Qt 5.14.2, which is the latest version my STM32MP157 OpenSTLinux Distribution targets. (I know there are future updates for that distribution, but that's the one I'm locked to for now). When I use this qmake to build my application, the resulting output file is ~6MB.

    I was previously developing on a Windows 10 Host using a VirtualBox Debian Guest VM provided by another display provider, DLOGIC, that had already built a qmake for an embedded target with Qt 5.9.x. This qmake built images that were also able to run on my STM32MP157 MPU. When I use this qmake to build my application (same source /project files as above), the resulting output file is ~2MB.

    I compared the two qmake.config files from the different qmake builds and cannot figure out what has been changed in my Qt 5.14.2 qmake build that is making my output file bloat ~4MB. Can anyone provide some assistance? I feel like it's an obvious command line argument I've overlooked and a new set of eyes will see it. Both qmake.config files are attached.

    Thank you for your time

    Ubuntu_6MB_qmake.png Debian_2MB_qmake.png

    1 Reply Last reply
    0
    • C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 4 Jun 2021, 17:18 last edited by
      #2

      I would guess the additional file size comes from the included debug symbols. Try to e.g. strip them to see if the file size goes down to 2MB

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 4 Jun 2021, 18:05 last edited by
        #3

        Hi and welcome to devnet,

        Beside the check @Christian-Ehrlicher suggested. If you want to minimize the size of you executable, one other thing you can do is build a custom version of Qt with all that you do not use disabled. For example the regular expression stuff, the model view, etc. It takes some patience but can drastically reduce your memory footprint.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • J Offline
          J Offline
          J_Kolonis
          wrote on 16 Jun 2021, 18:07 last edited by
          #4

          Thank you both for the suggestions! I ran /usr/bin/arm-linux-gnueabihf-strip on one and it reduced it from a size of 6468168 to 6262788, so a reduction of ~0.2MB.

          I didn't realize removing the modules I selected for my qmake would change my application output size - I assumed if I wasn't using those modules they wouldn't be built into my resulting binary file. I will try this and report any findings.

          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