Reducing Qt installation directory size



  • We manually build Qt 4.8.7 here. I am trying to reduce the size of our Qt installation directory as much as possible. One of my strategies is to exclude as much as possible at configure time. For example, this is my configure command:

    configure -prefix D:\Qt\builds\win32-x86-vc110-xp\4.8.7 ^
                   -confirm-license ^
                   -debug-and-release ^
                   -opensource ^
                   -platform win32-msvc2012 ^
                   -no-sse ^
                   -no-sse2 ^
                   -openssl -I D:\OpenSSL\builds\win32-x86-vc110-xp\1.0.2e\include -L D:\OpenSSL\builds\win32-x86-vc110-xp\1.0.2e ^
                   -no-webkit ^
                   -no-opengl ^
                   -no-phonon ^
                   -no-phonon-backend ^
                   -no-multimedia ^
                   -no-audio-backend ^
                   -no-scripttools ^
                   -no-declarative ^
                   -no-declarative-debug ^
                   -nomake examples ^
                   -nomake demos ^
                   -mp ^
                   -saveconfig bart
    

    However, after an nmake install, my install directory is still 784 MB, of which the doc directory takes 323 MB:

    $ du -sc * | sort -n
    28      demos
    176     examples
    336     phrasebooks
    336     q3porting.xml
    2132    mkspecs
    8201    translations
    14812   include
    30460   plugins
    103096  bin
    302028  lib
    323108  doc
    784713  total
    

    My question is twofold:

    1. Is there a way to avoid the docs being generated and copied over to the Qt installation directory? I don't see a -no-docs option at configure time... I could of course manually remove the doc directory after the nmake install, but if I can avoid that it is being created by using the appropriate configure option, that would even be nicer (shorter build times and no need to manually delete afterwards).

    2. Are there any other configure tricks that I can use to reduce the size of my installation directory after an nmake install?


  • Moderators

    Not an answer to your questions: why do you use -no-sse and -no-sse2? This will not make your binaries smaller but slower.
    If you don't need debug information you should not use -debug-and-release, use -release instead.


  • Qt Champions 2016

    Not an answer to your questions: why do you use -no-sse and -no-sse2? This will not make your binaries smaller but slower.

    I second that!

    @Bart_Vandewoestyne

    Is there a way to avoid the docs being generated and copied over to the Qt installation directory?

    I for one don't know of any.

    Are there any other configure tricks that I can use to reduce the size of my installation directory after an nmake install?

    Your installation directory is what you use to extract the binaries for deployment, it's not supposed to be deployed as such.

    Additionally, you seem to use nmake, which as far as I know is MS's variant of the linux's make, but somehow du -sc * | sort -n? It doesn't make much sense to me.

    Kind regards.



  • @jsulm said:

    Not an answer to your questions: why do you use -no-sse and -no-sse2? This will not make your binaries smaller but slower.

    One of the target platforms we still have to support is a Windows XP Embedded device with a Geode processor. According to http://wiki.laptop.org/go/Geode_instruction_set it does not fully support SSE nor SSE2. If we did compile with SSE and SSE2, we got "Illegal Instruction" errors at runtime.

    If you don't need debug information you should not use -debug-and-release, use -release instead.

    We do need debug info.



  • @kshegunov

    Additionally, you seem to use nmake, which as far as I know is MS's variant of the linux's make, but somehow du -sc * | sort -n? It doesn't make much sense to me.

    We indeed use Visual Studio 2012 on Windows, but that doesn't mean we can't use Cygwin: http://cygwin.org/ ;-)


  • Qt Champions 2016

    @Bart_Vandewoestyne
    Yes I forgot that this exists. Anyway, this was a side note and it's not very important. However I still don't get why do you need to reduce the size of your build folder ... you just deploy those dll's that you're actually using, no?



  • @kshegunov said:

    @Bart_Vandewoestyne
    However I still don't get why do you need to reduce the size of your build folder ... you just deploy those dll's that you're actually using, no?

    I forgot to mention: we're storing our Qt build in our version management system, so that's why I want to keep its size as minimal as possible (without loosing any functionality).


  • Qt Champions 2016

    @Bart_Vandewoestyne said:

    we're storing our Qt build in our version management system

    This is a strange thing to do, since Qt guarantees binary compatibility between minor versions, but well, you're free to choose. Unfortunately, I don't see how you could decrease the size further, beside deleting the docs, as the libraries are in the /lib directory and they're the next biggest size. Maybe store only the libs that you're using, i.e. these that you're going to deploy. No point in keeping QtXml if you're not using it, right?



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.