Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the meaning of "make -j" without a number

Tags:

makefile

I am using "make" command to compile. I know if I use "make -jN", N indicates the job number. But if I don't use any number after -j, what does it mean?

like image 800
Jade Avatar asked Oct 16 '18 07:10

Jade


People also ask

What is J in make?

2. Save this answer. The -j option tells make how many jobs (commands) to run in parallel. This is limited by how many physical CPUs and RAM your system has. Many make jobs use as many CPUs as it finds in the system.

What is the J parameter in make?

Using -j alone tells make that it should run all the jobs that can possibly be built, without any consideration of system resources. It doesn't look at how many CPUs you have, how much memory you have, how high the load is on your system, or anything else.

What is J $( Nproc?

The most straight-foward way is to use nproc like so: make -j`nproc` The command nproc will return the number of cores on your machine.

What does J mean in Linux?

-j [jobs], --jobs[=jobs] Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the last one is effective. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously. -k, --keep-going.


1 Answers

No number means no limit.

From the GNU Make manual [emphasis mine]:

If the ‘-j’ option is followed by an integer, this is the number of recipes to execute at once; this is called the number of job slots. If there is nothing looking like an integer after the ‘-j’ option, there is no limit on the number of job slots. The default number of job slots is one, which means serial execution (one thing at a time).

like image 174
sergej Avatar answered Oct 23 '22 05:10

sergej