[Suggestion] QtCreator parallel compilation

  • In MS Visual Studio large solution with many projects may be compiled in "parallel" mode. It analyzes dependencies between projects and runs parallel compilation of projects on all available CPUs if projects are not dependent from each other.

    QtCreator supplied with Qt 4.6.3 does not support this feature. Please correct me if I am wrong.

    Are any plans exist to implement it in future releases? It speeds up compilation of large projects. Currently it is one of arguments to use MS Visual Studio against the QtCreator in our project (MS Visual Studio reduces compilation time).

  • Moderators

    This is supported provided you are using qmake (or any other supported build system) to tie together the projects.

    It is not planned to have Qt Creator analyse dependencies between projects directly: The build systems do an excellent job with tracking dependencies between files, so we do not want to duplicate that in creator.

  • [quote author="Tobias Hunger" date="1290069977"]This is supported provided you are using qmake (or any other supported build system) to tie together the projects.[/quote]

    Thank you for reply. Please drop a link or provide more details how can I use qmake to configure "parallel" building of many project from QtCreator.

  • Moderators

    blex: Qmake is unfortunately somewhat under-documented. I found it best to just learn from examples: Qt Creator has a working dependency setup in src/plugins/plugins.pro.

  • Go to the project view of Qt Creator, then to the build settings tab. If you have a qmake project there are some details on the build steps. The second one should be the details on the make step. You can add additional command line arguments to make there - just add -j4 to build four object files in parallel. That increases compiling speed too. You cannot build two separate projects (with their own .pro file) in parallel; but that's not a drawback anyways, as with the -jX switch your CPU is busy too.

  • Thanks a lot. It works.

    One step forward to switch to QtCreator from MS Visual Studio :)

  • You're welcome. The -jX switch is a better solution, in my opinion. Even if you have only on project you can compile multiple source files in parallel. As far as I remember this is not possible with VS.

  • [quote author="Volker" date="1290118950"]As far as I remember this is not possible with VS.[/quote]

    Yes, it is not possible. So, sometimes one or more CPU cores are idle while compiling with MSVC.

  • Yes, I noticed that. I have quad core cpu and only two projects to compile, so half of the whole system is idling around (and even VS is not snappy sometimes). So I really like the make -jX approach.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.