PDA

View Full Version : Optimized Qt compilation



quimnuss
14th September 2015, 10:46
I am building static Qt targeting a non very powerful single processor XP machine. (apparently Pentium III, Intel Pentium 1.10 GHz)

I've managed to compile it but how can I build it with optimized flags /O3 etc. and what about sse2 and so on?

The application is too slow and can't keep up with the sent signals sent at 1Hz.

anda_skoa
14th September 2015, 11:07
You can add to QMAKE_CFLAGS and QMAKE_CXXFLAGS in your .pro file.

Also make sure you are doing actual profiling to check if any code paths can be written more efficiently.

Cheers,
_

quimnuss
14th September 2015, 12:59
Hello again anda_skoa, I'll definitely give you credit on the application About or something!

You are talking about the project .pro, but I'm referring to the qt static library. I guess both can be optimized and I'm wondering about the latter.

ATM I was going to compile Qt with the following options:



configure -static -static-runtime -no-harfbuzz -no-angle -no-opengl -no-openssl -no-freetype -no-ssl -release -opensource -confirm-license -mp -nomake examples -nomake tests -c++11 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -skip webengine -skip webkit -skip webkit-examples -no-warnings-are-errors -sse4.2 -prefix C:\Qt\Static\msvc2xp -platform win32-msvc2013 -target xp


regarding the .pro, I'm adding Ox. I have to check which other flags does msvc have.

Added after 1 18 minutes:

I've found the mkspecs under qtbase, but nothing changes if I change, say, the compiler line.

Which makespecs is 'configure' reading? How can I know?

I'm running a shell with:



C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>REM Set up \Microsoft Visual
Studio 2013, where <arch> is \c amd64, \c x86, etc.

C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>CALL "C:\Program Files (x86)
\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" x86

C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>SET _ROOT=C:\Qt\Static\src\q
t-everywhere-opensource-src-5.5.0

C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>SET PATH=C:\Qt\Static\src\qt
-everywhere-opensource-src-5.5.0\qtbase\bin;C:\Qt\Static\src\qt-everywhere-opens
ource-src-5.5.0\gnuwin32\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0
\Common7\IDE\CommonExtensions\Microsoft\TestWindow ;C:\Program Files (x86)\Micros
oft SDKs\F#\3.1\Framework\v4.0\;C:\Program Files (x86)\MSBuild\12.0\bin;C:\Progr
am Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\;C:\Program Files (x86)\
Microsoft Visual Studio 12.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Stud
io 12.0\Common7\Tools;C:\Windows\Microsoft.NET\Framew ork\v4.0.30319;C:\Program F
iles (x86)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Files (x86)\HTM
L Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\P
erformance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program File
s (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\;C:\Program Files (x8
6)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA GPU Computing Toolkit
\CUDA\v7.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\libnvvp;C
:\Ruby22\bin;C:\Perl64\site\bin;C:\Perl64\bin;C:\P ython27\;C:\Python27\Scripts;C
:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\
Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\ Syste
m32\Wbem;C:\Windows\System32\WindowsPowerShell\v1. 0\;C:\Program Files (x86)\Wind
ows Live\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Fil
es (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\
Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\
;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Git\
cmd;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\CMake\bin;C:\Program F
iles (x86)\Skype\Phone\;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\PD
Ftk\bin\;C:\Program Files\SlikSvn\bin;C:\Program Files\MATLAB\R2009b\runtime\win
64;C:\Program Files\MATLAB\R2009b\bin;C:\Program Files (x86)\Windows Kits\8.1\Wi
ndows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsof
t SQL Server\110\Tools\Binn\;C:\Windows\system32\config\ systemprofile\.dnx\bin;C
:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Microsoft Emulator Ma
nager\1.0\;C:\Users\Pol\Desktop\flightPlanQt\lib\g dalwin32-1.4.1\bin;C:\texlive\
2014\bin\win32;C:\Users\Pol\AppData\Roaming\npm;C: \Program Files (x86)\Java\jre7
\bin;C:\Program Files (x86)\MSBuild\12.0\Bin\;C:\Program Files (x86)\Microsoft V
isual Studio 12.0\VC\bin\;C:\Qt\5.5\msvc2013_64\bin;C:\Qt\5.5\m svc2013_64\lib;C:
\Python27;C:\Perl64\bin

C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>REM Uncomment the below line
when using a git checkout of the source repository

C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>REM SET PATH=C:\Qt\Static\sr
c\qt-everywhere-opensource-src-5.5.0\qtrepotools\bin;C:\Qt\Static\src\qt-everywh
ere-opensource-src-5.5.0\qtbase\bin;C:\Qt\Static\src\qt-everywhere-opensource-sr
c-5.5.0\gnuwin32\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7
\IDE\CommonExtensions\Microsoft\TestWindow;C:\Prog ram Files (x86)\Microsoft SDKs
\F#\3.1\Framework\v4.0\;C:\Program Files (x86)\MSBuild\12.0\bin;C:\Program Files
(x86)\Microsoft Visual Studio 12.0\Common7\IDE\;C:\Program Files (x86)\Microsof
t Visual Studio 12.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 12.0\
Common7\Tools;C:\Windows\Microsoft.NET\Framework\v 4.0.30319;C:\Program Files (x8
6)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Files (x86)\HTML Help W
orkshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performan
ce Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\
Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\;C:\Program Files (x86)\NVIDI
A Corporation\PhysX\Common;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7
.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\libnvvp;C:\Ruby22
\bin;C:\Perl64\site\bin;C:\Perl64\bin;C:\Python27\ ;C:\Python27\Scripts;C:\Progra
mData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program
Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\ System32\Wbem
;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Pr ogram Files (x86)\Windows Live
\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Prog
ram Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)
\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\In
tel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Prog
ram Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Git\cmd;C:\P
rogram Files (x86)\Git\bin;C:\Program Files (x86)\CMake\bin;C:\Program Files (x8
6)\Skype\Phone\;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\PDFtk\bin\
;C:\Program Files\SlikSvn\bin;C:\Program Files\MATLAB\R2009b\runtime\win64;C:\Pr
ogram Files\MATLAB\R2009b\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Pe
rformance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Prog
ram Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Se
rver\110\Tools\Binn\;C:\Windows\system32\config\sy stemprofile\.dnx\bin;C:\Progra
m Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Microsoft Emulator Manager\1.
0\;C:\Users\Pol\Desktop\flightPlanQt\lib\gdalwin32-1.4.1\bin;C:\texlive\2014\bin
\win32;C:\Users\Pol\AppData\Roaming\npm;C:\Program Files (x86)\Java\jre7\bin;C:\
Program Files (x86)\MSBuild\12.0\Bin\;C:\Program Files (x86)\Microsoft Visual St
udio 12.0\VC\bin\;C:\Qt\5.5\msvc2013_64\bin;C:\Qt\5.5\m svc2013_64\lib;C:\Python2
7;C:\Perl64\bin

C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>SET QMAKESPEC=win32-msvc2013


C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>SET _ROOT=

C:\Qt\Static\src\qt-everywhere-opensource-src-5.5.0>


Cheers