[Qt-creator] optimization and file size between versions

Duane duane.hebert at group-upc.com
Fri Sep 27 16:28:45 CEST 2013


On 9/27/2013 10:18 AM, Duane wrote:
> On 9/27/2013 9:51 AM, Orgad Shaneh wrote:
>>
>> בתאריך 2013 9 27 16:49, מאת "Duane" <duane.hebert at group-upc.com
>> <mailto:duane.hebert at group-upc.com>>:
>>   >
>>   > On 9/27/2013 9:43 AM, Ziller Eike wrote:
>>   > >
>>   > > On 27.09.2013, at 14:52, Duane <duane.hebert at group-upc.com
>> <mailto:duane.hebert at group-upc.com>> wrote:
>>   > >
>>   > >> On 9/27/2013 8:21 AM, Orgad Shaneh wrote:
>>   > >>>
>>   > >>> בתאריך 2013 9 27 15:15, מאת "Duane" <duane.hebert at group-upc.com
>> <mailto:duane.hebert at group-upc.com>
>>   > >>> <mailto:duane.hebert at group-upc.com
>> <mailto:duane.hebert at group-upc.com>>>:
>>   > >>>>
>>   > >>>> I have Qt Creator version 2.7.2 and am using Qt 4.8.4.  My
>> colleague has
>>   > >>>> Qt Creator version 2.4.1 and is using Qt 4.8.1.  We are both
>> running the
>>   > >>>> Fedora 16.  We use the same project file and this project
>> doesn't use
>>   > >>>> the Qt libs.
>>   > >>>>
>>   > >>>> The .pro file has
>>   > >>>> TEMPLATE = app
>>   > >>>> CONFIG += console
>>   > >>>> CONFIG -= qt
>>   > >>>>
>>   > >>>>
>>   > >>>> When he builds he gets an executable 1.5Mb.  When I build, I get an
>>   > >>>> executable of 10.6Mb  Both are release builds.  We both use the same
>>   > >>> libs.
>>   > >>>>
>>   > >>>> What can cause this?  How is optimization done here?  We build
>> the same
>>   > >>>> project for Windows in Visual Studio and the exe files are the
>> same size
>>   > >>>> but we've set the same optimization.
>>   > >>>>
>>   > >>>> _______________________________________________
>>   > >>>> Qt-creator mailing list
>>   > >>>> Qt-creator at qt-project.org <mailto:Qt-creator at qt-project.org>
>> <mailto:Qt-creator at qt-project.org <mailto:Qt-creator at qt-project.org>>
>>   > >>>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>   > >>>
>>   > >>> Can you paste the build output for both machines? A single file gcc
>>   > >>> invocation and a single linker invocation should be enough (if the
>>   > >>> project is not very complex).
>>   > >>>
>>   > >>
>>   > >>
>>   > >> This would be quite a bit.  It's not a simple project.  But I have
>> tried
>>   > >> a few things.  My Qt Creator SDK installation installed Qt 5.1.  So I
>>   > >> switched the kit to use this.  My build size goes from 10.6Mb to
>> 8.6Mb.
>>   > >>   This was surprising.  So then I found my older version of Qt
>> 4.8.1.  I
>>   > >> switched to that one and my file size becomes the same as my
>> Colleague.
>>   > >>   1.5Mb.  So it's definitely the Qt version affecting this.  AFAIK
>> these
>>   > >> versions were installed with Qt Toolkits and not build manually.
>>    So I'm
>>   > >> not sure what the difference would be.  I would maybe understand
>> this is
>>   > >> I was using any Qt libs but we're not for this application.  Make
>> flags
>>   > >> look the same on the two systems.  I don't get it.
>>   > >
>>   > >
>>   > > debug vs release build maybe?
>>   > >
>>   >
>>   > I started to say no, but then again when I switch from release to debug
>>   > the file size doesn't change.  Something is broken here.  But when I
>>   > switch to 4.8.1 things seem ok.  I am currently building 4.8.5 to try
>>   > that and see if it makes a difference.
>>   >
>>   > _______________________________________________
>>   > Qt-creator mailing list
>>   > Qt-creator at qt-project.org <mailto:Qt-creator at qt-project.org>
>>   > http://lists.qt-project.org/mailman/listinfo/qt-creator
>>
>> Try adding "QT=" to your project.
>>
>
>
> Didn't help.  One thing that I do notice is that I don't see +=Release
> in the build string:
>
> 10:04:08: Starting: "/usr/bin/qmake-qt4"
> /home/duane/QtSDK/PT500Projects/visu32/visu32.pro -r -spec linux-g++
> 10:04:08: The process "/usr/bin/qmake-qt4" exited normally.
> 10:04:09: Starting: "/usr/bin/make"
> g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
> -fasynchronous-unwind-tables -O2 -Wall -W -Wno-write-strings
> -Wno-unused-parameter -Wno-unused-variable -DBPP32 -DPT470BUILD
> -I/usr/lib/qt4/mkspecs/linux-g++ -I../visu32
> -I../../../SVN_Repos/PT470Development/src/include
> -I../../../SVN_Repos/PT470Development/OpenGUI/src
> -I../../../SVN_Repos/PT470Development/OpenGUI/src -I../visu32 -I. -o
> main.o ../../../SVN_Repos/PT470Development/src/visu32/main.cpp
> ...



When I build with 4.8.1 is see this:

10:20:09: Starting: "/home/duane/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake" 
/home/duane/QtSDK/PT500Projects/visu32/visu32.pro -r -spec linux-g++ 
CONFIG+=release
10:20:09: The process "/home/duane/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake" 
exited normally.
10:20:09: Starting: "/usr/bin/make"  ...


The =+release is there.





More information about the Qt-creator mailing list