Parallel compilation of Qt in Windows
来源:互联网 发布:淘宝举报电话是多少 编辑:程序博客网 时间:2024/05/21 14:47
http://sysmagazine.com/posts/137428/
Parallel compilation of Qt-projects under Windows with usage of QtCreator — an animal mysterious and very choosy. In this small article I will tell, how all the same it to tame. Parallel compilation could be fulfill simply enough in the theory, in practice of business was not absolutely smoothly, to that in acknowledgement the infinite number of subjects at forums where various decisions was offer. Any of them, unfortunately, doing not help us.
In the theory for a case of MinGW it are enough to specify parameter – j [number of compile processes] at a command of the assembly of make who are present to QtSDK MinGW to mingw32-make. For example, the command mingw32-make.exe – j10 turned out.
The recommend number of compile processes made number процессоров+1. If the parameter are not set, it are considered that j=1. If to specify too great number also anything terrible does not happen. Make will launch exactly so much, how many gave an increase of productivity.
For convenience it are possible to use a variable surrounding of %NUMBER_OF_PROCESSORS % which showed number of processors in system. The command of a type turned out mingw32-make.exe –j%NUMBER_OF_PROCESSORS%
However, not all so are simple. Qmake created three make-files. The common Makefile which on particular define’ам selected from Makefile.Debug and Makefile.Release depending on the assembly of release or debaga. The matter is that parameter – j not heritable. And when in QtCreator make it are caus for Makefile are caus. And here Makefile.Debug or Makefile.Release did not reach any more.
That it to correct it is necessary to write a command in an explicit form. For example,mingw32-make.exe –j9 –f Makefile.Debug.
Not so conveniently, but the increase of speed of the assembly strongly compensated it. For an example, the reassembly of our project on core-i7-2630 without multisequencing are carr out in 12 minutes, with a flag – j9 the assembly occupied less than two minutes. The increase of productivity six times set thinking.
But even after instructions of such flags of the assembly by two machines it beginning to work for us, and on two are not present. At forums written that business could be in the version of Qt, in krivost of mingw, in singularities of operation of qmake, the version of OS. However, configurations of our machines was that that by process of elimination it are possible to draw an output on non-participation of versions of QtSDK, QtCreator, Windows or digit capacity of system in all to it.
The decision appeared very simple, but during too time not such obvious. It are necessary to add абcолютный a path to mingw32-make in a variable of a surrounding of PATH. Just in case, it are more best to deliver a semicolon after a way. And after that parallel compilation wonderfully started to work, and programmers should not distract for 10 minutes each time when adding any Q_OBJECT to the project and are more its to the reassembly.
All these flags of compilation could be set in QtCreator on the tab Projects in parameters of make.
I hopes, article will appear the useful and will solve questions of many at whom before the parallel assembly in QtCreator doing not work.
UPD (from comments): As to Linux/MacOS of users, to it carrying much more — enough only a key - jX.
Also if you used the MSVC compiler problems should not be.
In case of QtCreator it are necessary to add recordQMAKE_CXXFLAGS_RELEASE += -MP[число процессов]
in.pro as I describing a file of the project and establishment of a variable surrounding.
In case of the Visual Studio properties of VS of the project: «Properties» => «Configuration Properties» => «C/C ++» => «Command Line». And in the field of «Additional options» to add - MP [number of processes]. Thanks of IGHOR
Also at usage of the MSVC compiler jom could help.
The permanent part of flags can be carr out in a separate variable of a surrounding of MAKEFLAGS. Make took therefrom the install flags. For example MAKEFLAGS =-j10. And in parameters of make it are necessary only not to forget to specify a file for the assembly. For example, - f Makefile.Debug. If all of you time collected the one version it are possible to carry out all flags are whole in MAKEFLAGS and to forget about adjustment of the future projects.
Thanks all for additions.
- Parallel compilation of Qt in Windows
- Make VC++ Compiles Fast Through Parallel Compilation
- Use Of Cursors And Parallel Cursors In SAP ABAP
- Qt QtDBus compilation
- Compilation of Android kernel
- correction of ar_pose compilation
- gcc: Compilation Warning: incompatible implicit declaration of built-in function `bzero’
- Principles of parallel programming
- Simple implement of parallel
- Compute PI in parallel
- Parallel In-Place Merge
- Parallel scan in HBase
- GNU Parallel in caffe
- The compilation process of C
- Conditional Compilation In Java @ JDJ
- How to craw the Info of BiliBIli with python in Parallel
- How to craw the Info of BiliBIli with python in Parallel and MySQL storage
- Full Description of the compilation of Scilab
- 成都营销公司浅谈,大众化产品如何做营销
- Quartz任务调度快速入门
- PHP5.3 split() 不建议使用的原因: PHP 5.3.0 之后的regex, 希望使用PCRE 的规格, POSIX Regex 都不建议使用了(统一Regex, 避免规格太多). 所以
- opencv学习之VideoCapture
- 最佳日志实践
- Parallel compilation of Qt in Windows
- 迭代器模式
- Unsupported major.minor version 51.0
- 【边做项目边学Android】手机安全卫士11-设置向导之设置安全号码
- Linux下权限问题:chmod -R 777 /usr
- Adapter中ViewHolder用法
- android知识点:inputType常用取值
- 对 云寻觅贴吧(http://tieba.yunxunmi.com/)的简要分析
- Leetcode Swap Nodes in Pairs