Using Intel C++ compiler on Windows
-
Everyone good time of day!
I would like to ask the advice of the respected community about the use Intel C++ compiler on Windows for compiling Qt-projects.
The fact is that on the site - https://doc.qt.io/archives/qt-4.7/compiler-notes.html - it is written that Qt 4.7.0, I quote: "Qt supports the Intel C++ compiler on both Windows and Linux". However, by default, ICC is not built into the IDE, nor is it suggested to be added to the kit list during installation.
This didn't stop me, and I just downloaded the ICC (in the form of Intel oneAPI) from the Intel website. However, now I just can't connect this compiler to projects - the reason for the failure is the message "The Qt profile is not set for the kit". I honestly don't know what to do about it, because I really don't understand what he needs.
Note: i use Qt 5.12.
Thank you so much for any help!P.S. I apologize for my English, which is not my native language :)
-
click projects->manage kits->kits
on kits tab:
click manual->Desktop Default or create your own
you will see compiler C: and C++: options
select icc/icpc -
https://doc.qt.io/qtcreator/creator-tool-chains.html
ICC (Intel C++ Compiler) is a group of C and C++ compilers. Only the GCC-compatible variant, available for Linux and macOS, is currently supported by Qt Creator.
******** not on Windows ************** -
However, you can use VS with Intel C++ to compile Qt code.
-
https://doc.qt.io/qtcreator/creator-tool-chains.html
ICC (Intel C++ Compiler) is a group of C and C++ compilers. Only the GCC-compatible variant, available for Linux and macOS, is currently supported by Qt Creator.
******** not on Windows **************@JoeCFD said in Using Intel C++ compiler on Windows:
Only the GCC-compatible variant, available for Linux and macOS, is currently supported by Qt Creator
That's what I don't understand the most. Qt 4 supported this compiler, but Qt 5 suddenly stopped. Some kind of mystique.
@JoeCFD said in Using Intel C++ compiler on Windows:
However, you can use VS with Intel C++ to compile Qt code
Could you tell me exactly how I can do this? Will MSVC see the specific functions of Qt? Will he allow you to start assembling commands unknown to him? Or can I just copy the whole code and it won't cause any problems?
-
https://doc.qt.io/qtvstools/index.html
I prefer to use VS + Qt on Windows. Sure, QtCreator on Linux -
https://doc.qt.io/qtvstools/index.html
I prefer to use VS + Qt on Windows. Sure, QtCreator on Linux -
@JoeCFD said in Using Intel C++ compiler on Windows:
use VS + Qt on Windows
Ah, that is, Qt integrates well into MSVS, which allows you to use all the same commands and functions as in Qt Creator?
-
There is a Qt plugin for VS. This can import Qt projects and handle most of the stuff automatically. I personally prefer to use
qmake.exe -tp vc MyProject.pro
to generate a VS project file. If you want to be portable (Linux/macOS) I would say it is the preferred way to always make changes to the .pro file (adding/deleting files) and regenerate the VS project from it.I believe (I am not a great fan of the Qt plugin for VS and don't use it) that the Qt plugin does all the stuff necessary for the project file. But, it does not have the Qt Designer built in. You need to use Qt's own tools to still edit UI-files.
If ICC does not show up inside Qt Creator automatically, you can add it by hand and then add it to a kit. I am not sure how well that is supported. Is there any specific reason you want to use ICC? A while back (I believe it was ICC v14) I did some benchmarks and ICC did not optimize OO code. It was slightly faster with regular C code, but no meaningful optimizations for C++. Only this year did they start to use clang as backend and I would expect that this version of the current ICC could actually be better. If you don't make sure to use the clang-variant of ICC and don't have any other specific reasons to use it (performance at least wasn't a reason a while back), just use one of the default compilers on Windows.