Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Suggestion] QtCreator parallel compilation
QtWS25 Last Chance

[Suggestion] QtCreator parallel compilation

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 3 Posters 13.9k Views
  • 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 Offline
    B Offline
    blex
    wrote on last edited by
    #1

    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
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      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
      0
      • B Offline
        B Offline
        blex
        wrote on last edited by
        #3

        [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
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          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
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            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
            1
            • B Offline
              B Offline
              blex
              wrote on last edited by
              #6

              Thanks a lot. It works.

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


              Oleksiy Balabay

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                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
                0
                • B Offline
                  B Offline
                  blex
                  wrote on last edited by
                  #8

                  [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
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #9

                    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
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved