The most of us holds a multicore system, but often we don't use this characteristic, especially when we need to compile our programs.

In linux, you can use the boost of the multicore simply defining an environment variable. The CONCURRENCY_LEVEL variable.

I want to provides a simple example to understand the power of this variable. Let's compile the kernel 3.0.0.

First we try without any options:

# cd /usr/src/linux

# echo "Y"|make config

# time make

The results on my laptop are as follows:

real 112m8.846s

user 97m2.304s

sys 8m16.867s

Then we try with 5 processes running in parallel:


# make clean

# time make

And the results are the following:

real 69m19.437s

user 109m24.562s

sys 9m2.986s


As you can see we can gain a lot of time…

There is also another way to parallelize the make process, the -j option of the make command specifies the number of parallel compiling processes. So you can type the following command:

# time make -j 5

instead of setting the concurrency_level variable.