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. QtCreator 4.0.0 no more mingw parallel compilation
QtWS25 Last Chance

QtCreator 4.0.0 no more mingw parallel compilation

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
creator4.0.0qtcreatorparallelcompilation
13 Posts 5 Posters 5.7k 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.
  • K Offline
    K Offline
    Keyos
    wrote on 25 May 2016, 10:30 last edited by Keyos
    #1

    About a week ago i was using QtCreator 3.6.1 and it was starting parallel compilation on all targets/kits (mingw, msvc2013....) using 100% of the cpu and doing it's work quickly.
    Now since i got the QtCreator 4.0.0 the mingw target/kit use only 1 compilation thread, actually slowing down the total compilation time by a factor of about 1/n_cpu_cores, i'm not sure if i need to change any particular option with the new creator version, as it was working fine in the previous ones by default.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Keyos
      wrote on 9 Jun 2016, 07:48 last edited by
      #2

      I just updated QtCreator from 4.0.0 to 4.0.1 but the the mingw target still compile using one single core, there is a way to set the mingw kit to spread compilations on all avaiable cores like it was doing in the QtCreator 3.xx version?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 9 Jun 2016, 22:11 last edited by
        #3

        Hi,

        You should compare the build output of both version of Qt Creator so see if there's anything changed between the two.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Keyos
          wrote on 13 Jun 2016, 12:17 last edited by Keyos
          #4

          Looks like i have to manually override the make setting for every project changing:
          MAKE: C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe
          to
          MAKE: C:\Qt\Tools\QtCreator\bin\jom.exe
          than i can build quickly again taking advantage of all cpu cores.
          I have no idea how i can set this override globally.

          I can't remember what was the compile output when i was using the creator 3.6.1 about 2 weeks ago, but it was distributing the compilations automatically on all cpu cores without the need to change any settings.
          In the "build & run" options the "use jom" checkbox is checked like it was before, so i have no idea why old kits was using multiple compilation threads out of the box and now since the creator 4.0.0 you have to manually force it for mingw.

          J D 2 Replies Last reply 13 Jun 2016, 12:40
          0
          • K Keyos
            13 Jun 2016, 12:17

            Looks like i have to manually override the make setting for every project changing:
            MAKE: C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe
            to
            MAKE: C:\Qt\Tools\QtCreator\bin\jom.exe
            than i can build quickly again taking advantage of all cpu cores.
            I have no idea how i can set this override globally.

            I can't remember what was the compile output when i was using the creator 3.6.1 about 2 weeks ago, but it was distributing the compilations automatically on all cpu cores without the need to change any settings.
            In the "build & run" options the "use jom" checkbox is checked like it was before, so i have no idea why old kits was using multiple compilation threads out of the box and now since the creator 4.0.0 you have to manually force it for mingw.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 13 Jun 2016, 12:40 last edited by jsulm
            #5

            @Keyos make does not use multiple cores by default, you need to pass -j NUMBER_OF_THREADS as parameter to it (in Projects tab).

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • K Keyos
              13 Jun 2016, 12:17

              Looks like i have to manually override the make setting for every project changing:
              MAKE: C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe
              to
              MAKE: C:\Qt\Tools\QtCreator\bin\jom.exe
              than i can build quickly again taking advantage of all cpu cores.
              I have no idea how i can set this override globally.

              I can't remember what was the compile output when i was using the creator 3.6.1 about 2 weeks ago, but it was distributing the compilations automatically on all cpu cores without the need to change any settings.
              In the "build & run" options the "use jom" checkbox is checked like it was before, so i have no idea why old kits was using multiple compilation threads out of the box and now since the creator 4.0.0 you have to manually force it for mingw.

              D Offline
              D Offline
              Devopia53
              wrote on 13 Jun 2016, 12:41 last edited by Devopia53
              #6

              @Keyos

              Hi,

              You can set the system environment variable.
              like this: MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exe

              or

              Tools -> Options -> Build & Run -> Kits -> Select kit -> Environment -> Change... -> Add : MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exe -> Ok

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Keyos
                wrote on 13 Jun 2016, 12:57 last edited by
                #7

                Thank you very much for the informations!
                Than i presume the old creator (3.6.1) was using jom or pasing "-j NUMBER_OF_THREADS" to mingw32-make by default and somehow this feature have been lost in the passage to the new 4.x.x as i can see the variable NUMBER_OF_THREADS is set correctly to 4 on my setup

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Keyos
                  wrote on 13 Jun 2016, 13:05 last edited by
                  #8

                  Sorry i meant "NUMBER_OF_PROCESSORS=4" wich is set by default correctly after the installation, but i suppoose the meaning and purpose is the same as "NUMBER_OF_THREADS" when calling mingw32-make with -j option

                  J K 2 Replies Last reply 14 Jun 2016, 05:18
                  0
                  • K Keyos
                    13 Jun 2016, 13:05

                    Sorry i meant "NUMBER_OF_PROCESSORS=4" wich is set by default correctly after the installation, but i suppoose the meaning and purpose is the same as "NUMBER_OF_THREADS" when calling mingw32-make with -j option

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 14 Jun 2016, 05:18 last edited by
                    #9

                    @Keyos You should use number of threads. On CPUs with hyper threading it means: number of cores * 2. Then you can utilize your CPU better.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      Keyos
                      wrote on 16 Jun 2016, 07:52 last edited by
                      #10

                      I wonder why they stopped using jom or passing the -j option when using the mingw kit by default since the qtcreator 4.0.0
                      There is a reason like for example jom is not reliable or they just forgot to call it?

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 16 Jun 2016, 07:55 last edited by
                        #11

                        As far as I know -j was never passed by default.
                        Not sure about jom.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • K Keyos
                          13 Jun 2016, 13:05

                          Sorry i meant "NUMBER_OF_PROCESSORS=4" wich is set by default correctly after the installation, but i suppoose the meaning and purpose is the same as "NUMBER_OF_THREADS" when calling mingw32-make with -j option

                          K Offline
                          K Offline
                          koahnig
                          wrote on 25 Jun 2016, 20:57 last edited by
                          #12

                          @Keyos said:

                          Sorry i meant "NUMBER_OF_PROCESSORS=4" wich is set by default correctly after the installation, but i suppoose the meaning and purpose is the same as "NUMBER_OF_THREADS" when calling mingw32-make with -j option

                          I have updated today (unfortunately, I had to) from an old Qt creator version 3.2 to Qt creator version 4.0.2 and assumed that I have encountered the same problem.

                          My standard environment has also "NUMBER_OF_PROCESSORS=4" and suddenly the compilation took ages after upgrading. With a couple of trials I have found that also adding this seting to project environment and "NUMBER_OF_THREADS=4" does not influence the compiling.

                          Either you need to add "-j4" as make parameter to each of your projects. Otherwise you can set also "MAKEFLAGS=-j4" to your environment (e.g. for a kit as suggested above).

                          jom was created as a substitute for nmake ( MS flavor of make). nmake does not support outside of VS multi core compilations. jom does support this when used in combination with ms compilers.

                          This blog suggest that jom detects the number of available cores automatically:
                          "To install jom, just extract the zip file to a directory which is in your PATH. Now, instead of calling nmake to build Qt, call jom. It automatically detects the number of processor cores in your PC by calling QThread::idealThreadCount().
                          You also can use the -j command line argument to set the number of concurrent processes."

                          Vote the answer(s) that helped you to solve your issue(s)

                          K 1 Reply Last reply 25 Jun 2016, 21:08
                          0
                          • K koahnig
                            25 Jun 2016, 20:57

                            @Keyos said:

                            Sorry i meant "NUMBER_OF_PROCESSORS=4" wich is set by default correctly after the installation, but i suppoose the meaning and purpose is the same as "NUMBER_OF_THREADS" when calling mingw32-make with -j option

                            I have updated today (unfortunately, I had to) from an old Qt creator version 3.2 to Qt creator version 4.0.2 and assumed that I have encountered the same problem.

                            My standard environment has also "NUMBER_OF_PROCESSORS=4" and suddenly the compilation took ages after upgrading. With a couple of trials I have found that also adding this seting to project environment and "NUMBER_OF_THREADS=4" does not influence the compiling.

                            Either you need to add "-j4" as make parameter to each of your projects. Otherwise you can set also "MAKEFLAGS=-j4" to your environment (e.g. for a kit as suggested above).

                            jom was created as a substitute for nmake ( MS flavor of make). nmake does not support outside of VS multi core compilations. jom does support this when used in combination with ms compilers.

                            This blog suggest that jom detects the number of available cores automatically:
                            "To install jom, just extract the zip file to a directory which is in your PATH. Now, instead of calling nmake to build Qt, call jom. It automatically detects the number of processor cores in your PC by calling QThread::idealThreadCount().
                            You also can use the -j command line argument to set the number of concurrent processes."

                            K Offline
                            K Offline
                            koahnig
                            wrote on 25 Jun 2016, 21:08 last edited by
                            #13

                            @koahnig said:

                            Either you need to add "-j4" as make parameter to each of your projects. Otherwise you can set also "MAKEFLAGS=-j4" to your environment (e.g. for a kit as suggested above).

                            Correction to above post. I have set it to system environment. I did not get it to work in kit environment. Both were set due to my trials, but the latter alone (in kit environment) does not help.

                            Vote the answer(s) that helped you to solve your issue(s)

                            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