Unsolved QtCreator 4.0.0 no more mingw parallel compilation
-
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. -
@Keyos make does not use multiple cores by default, you need to pass -j NUMBER_OF_THREADS as parameter to it (in Projects tab).
-
Hi,
You can set the system environment variable.
like this: MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exeor
Tools -> Options -> Build & Run -> Kits -> Select kit -> Environment -> Change... -> Add : MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exe -> Ok
-
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 -
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
-
@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.
-
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? -
As far as I know -j was never passed by default.
Not sure about jom. -
@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." -
@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.