Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    [Suggestion] QtCreator parallel compilation

    Tools
    3
    9
    13190
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      blex last edited by

      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).


      Oleksiy Balabay

      1 Reply Last reply Reply Quote 0
      • T
        tobias.hunger last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • B
          blex last edited by

          [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.


          Oleksiy Balabay

          1 Reply Last reply Reply Quote 0
          • T
            tobias.hunger last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • G
              goetz last edited by

              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.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply Reply Quote 1
              • B
                blex last edited by

                Thanks a lot. It works.

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


                Oleksiy Balabay

                1 Reply Last reply Reply Quote 0
                • G
                  goetz last edited by

                  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.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply Reply Quote 0
                  • B
                    blex last edited by

                    [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.


                    Oleksiy Balabay

                    1 Reply Last reply Reply Quote 0
                    • G
                      goetz last edited by

                      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.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post