Qt has just released the latest version 4.8.0, if you would like to compile this version using an Intel Compiler the steps are listed below.
Requirements
- Visual Studio 2010 or 2008
- Intel Compiler 12.1
I assume you will have these two pieces of software already installed, if not do install them now .
Downloading Qt 4.8.0
****Extract the contents of the zip to anywhere you like, but make sure the length of the path is not too long. Otherwise you will get an error randomly throughout your Qt build, and it might happen hours after you started!
NMAKE : fatal error U1077:
Building Qt
You will now need to go to your start bar and open a program called IA-32 Visual Studio 2010 mode.
This is a special command prompt which has all the variables set for building with Visual Studio 2010 tools using the Intel Compiler.
You will now need to change directory to the location of the Qt configure.exe. An example of the location of mine is show below.
1
|
cd C:\qt-4.8.0\
|
Once you have done that you need to choose a platform to select win32 with the Intel Compiler simply type:
1
|
configure -platform win32-icc
|
To select a win64 platform with the Intel Compiler, you will want to open the Intel 64 Visual Studio 2010 mode command prompt instead and run:
1
|
configure -platform win64-icc
|
If you want to make a more streamline build you may want to consider some of the following options:
1
2
3
4
5
6
7
|
-no-qt3support
//Disables the qt 3 support functionality
-no-opengl
// Disables OpenGL functionality
-mp
// use multiple processors for compiling
-ltcg
// This tells the linker to call the compiler
// and perform whole program optimization
// which may improve performance however
// increase the time to build release builds
|
Now at this point if the console returns:
Perl not found in environment - cannot run syncqt.
You can either go to into the Qt folder and look for a directory called bin and delete these two files:
syncqt
syncqt.bat
Or download and install Perl from ActivePerl *note once you have installed Perl you must close and reopen the Visual Studio 2010 command prompt, and make sure you select the one that starts the Intel Compiler.
Once configure is successful the console will return:
Qt is now configured for building. Just run nmake.
To reconfigure, run nmake confclean and configure.
Finally to build the Qt library type
1
|
nmake
|
This will start building the entire of Qt using the Intel Compiler which takes a little while, possibly 12-16 hours depending on your machine. However, this is normal I suggest you go to sleep!
Setting environment variables
Basically, we are done you now have compiled Qt with an Intel Compiler . All you need to do is to set your environment variables (QTDIR and PATH), which tell programs where to find Qt. If you are on Windows 7, you can use the following command to set QTDIR to your installation dir.
1
|
setx QTDIR c:\Qt-4.8.0
|
Also add the Qt/bin to your PATH.
You can now install the Visual Studio Add-in, and start a Qt project.
Enjoy!