From various sources (like this) state that you can parallelise your build jobs with:
make -j n
where n
is the number of jobs. In QNX 6.5.0 with GNU Make 3.81
I noticed that the number doesnt seem to work. If i call make -j
(no number) a huge number of compilers will be started and the processors will be used fully:
CPU states: 80.5% user, 5.0% kernel
CPU 0 Idle: 15.2%
CPU 1 Idle: 13.2%
CPU 2 Idle: 14.7%
Memory: 0 total, 281M avail, page size 4K
PID TID PRI STATE HH:MM:SS CPU COMMAND
8200 2 21 Rcv 0:00:17 12.02% devb-eide
43565087 1 10 Rdy 0:00:00 11.38% make
43819103 1 10 Rply 0:00:00 3.01% cmake
43716678 1 10 Rply 0:00:00 2.80% cmake
43671611 1 10 Rply 0:00:00 1.87% make
43589671 1 10 Rply 0:00:00 1.73% make
43569184 1 10 Rply 0:00:00 1.73% make
43573283 1 10 Rply 0:00:00 1.46% make
43667514 1 10 Rply 0:00:00 1.28% make
43839590 1 10 Send 0:00:00 1.10% cmake
Unfortunately when i use make -j
having the huge number of concurrent builds means that my limited VM quickly runs out of memory.
But if I add a number (eg. make -j 4
, which corresponds to the number of cores in my VM) then it will only ever start 1 process. This also occurs with the following variants:
make -j4
make -j 4
make --jobs=4
make --jobs 4
As well as with some other processor numbers (2, 3, 4, 5, 6, 7, 8).
Why doesnt make -j
with a specified number work in QNX?
The make
version used in the system must have been compiled using a configure item that disabled the -j
task engine. Recompiling GNU Make 3.81 and 4.2 yielded a binary that can successfully use the -j
switch with a number.