You are not logged in.

#1 2015-08-02 16:12:21

beta990
Member
Registered: 2011-07-10
Posts: 207

Compiling kernels take a lot of time

I have the following PC specs:
- Intel Core i5-2400 @ 2.4Ghz (no overclock)
- 8GB DDR3 1333Mhz
- ASUS P8H67-M Pro
- Samsung 840 SSD (building on /home)

Building a kernel (without unused/unneeded modules) takes more than 40 mins.
Even when using ccache, the compile speeds don't improve (at all).
The ~/.ccache folder is used (since it get's bigger every time after compiling), but don't know if it my PC or a configuration error.
Also tweaking /etc/makepkg.conf as stated in the .config didn't improved anything.

What build speeds should I expect with these specs.?
I have read reports from users that have build speeds of 7 mins. (but using different hardware configuration).

Thanks smile

Last edited by beta990 (2015-08-02 16:13:17)

Offline

#2 2015-08-02 16:18:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: Compiling kernels take a lot of time

40 minutes is a long time?!

The last time I build a kernel it ran for 8 hours.  Admittedly on lower spec hardware, but still.  It's a kernel - it will take a while.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-08-02 16:20:33

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: Compiling kernels take a lot of time

beta990 wrote:

I have the following PC specs:
- Intel Core i5-2400 @ 2.4Ghz (no overclock)
- 8GB DDR3 1333Mhz
- ASUS P8H67-M Pro
- Samsung 840 SSD (building on /home)

Building a kernel (without unused/unneeded modules) takes more than 40 mins.
Even when using ccache, the compile speeds don't improve (at all).
The ~/.ccache folder is used (since it get's bigger every time after compiling), but don't know if it my PC or a configuration error.
Also tweaking /etc/makepkg.conf as stated in the .config didn't improved anything.

What build speeds should I expect with these specs.?
I have read reports from users that have build speeds of 7 mins. (but using different hardware configuration).

Thanks smile

I use tmpfs. On my i7 4790K @ 4.4 GHz it takes about 10-15 minutes.


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#4 2015-08-02 16:56:58

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: Compiling kernels take a lot of time

+1 for tmpfs but that really won't affect speed.

Try modprobed-db from the AUR and only build the modules you need.  You will do this from a `make localmodconfig` in the kernel PKGBUILD.  See linux-ck's PKGBUILD for an example.  Doing this makes a significant difference.  Also see the wiki page for example build times.

Last edited by graysky (2015-08-02 17:19:17)

Offline

#5 2015-08-02 16:58:49

sekret
Member
Registered: 2013-07-22
Posts: 308

Re: Compiling kernels take a lot of time

Use

make localmodconfig

This will speed things up, because then it only builds modules your system uses right now.
edit: Or did you mean this by "without unused/unneeded modules"?

Last edited by sekret (2015-08-02 16:59:30)

Offline

#6 2015-08-02 17:11:58

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: Compiling kernels take a lot of time

sekret wrote:

Use

make localmodconfig

This will speed things up, because then it only builds modules your system uses right now.
edit: Or did you mean this by "without unused/unneeded modules"?

Yep smile

It should compile around the 120~ modules.

Offline

#7 2015-08-02 17:13:21

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Compiling kernels take a lot of time

beta990 wrote:

I have read reports from users that have build speeds of 7 mins

My custom kernel compiles in under 5 minutes. But it's stripped down, with unneeded modules removed.

At the other end of the scale - libreoffice 5 compiles in 118 minutes (i.e. 2 hours).

40 minutes for your *entire kernel* sounds about right.

Offline

#8 2015-08-02 17:59:47

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: Compiling kernels take a lot of time

graysky wrote:

+1 for tmpfs but that really won't affect speed.

Try modprobed-db from the AUR and only build the modules you need.  You will do this from a `make localmodconfig` in the kernel PKGBUILD.  See linux-ck's PKGBUILD for an example.  Doing this makes a significant difference.  Also see the wiki page for example build times.

I'm already running this on all my machines, will check if I can strip even more. smile

brebs wrote:
beta990 wrote:

I have read reports from users that have build speeds of 7 mins

My custom kernel compiles in under 5 minutes. But it's stripped down, with unneeded modules removed.

At the other end of the scale - libreoffice 5 compiles in 118 minutes (i.e. 2 hours).

40 minutes for your *entire kernel* sounds about right.

This sounds like you unset a lot of modules, also for print/*net support.
Aren't you missing anything? e.g. when trying new apps and/or hardware?

Weird that the kernel builds faster than Libreoffice, think the compiler makes a huge differences.

dockland wrote:

I use tmpfs. On my i7 4790K @ 4.4 GHz it takes about 10-15 minutes.

Will try tmpfs instead of my SSD. Thought the SSD would be fast enough.

Trilby wrote:

40 minutes is a long time?!

The last time I build a kernel it ran for 8 hours.  Admittedly on lower spec hardware, but still.  It's a kernel - it will take a while.

16 hours compiling on rPi. tongue

I'm compiling the kernels on my i5 and then install them on the target PC.
But still I would like to have some improvements in building the kernel.

Offline

#9 2015-08-02 18:02:25

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: Compiling kernels take a lot of time

Do not compile in RPi without distcc.

Offline

#10 2015-08-02 18:07:34

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: Compiling kernels take a lot of time

graysky wrote:

Do not compile in RPi without distcc.

But is it not limited by the Fa-port?
I still think compiling on the main and/or virtual machine (ARM) is faster than distcc.

Or I'm completely wrong? smile

Last edited by beta990 (2015-08-02 18:08:04)

Offline

#11 2015-08-02 19:34:07

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: Compiling kernels take a lot of time

My i3-2370M processor builds the generic kernels I maintain in 45 minutes, using the -j4 flag in /etc/makepkg.conf, going up to about 1h 20mins if I use -j1.

To me, it does sound like you're still building quite a generic kernel though. Stripping down with the tools suggested should cut down the build time quite a bit.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#12 2015-08-03 19:20:06

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: Compiling kernels take a lot of time

clfarron4 wrote:

My i3-2370M processor builds the generic kernels I maintain in 45 minutes, using the -j4 flag in /etc/makepkg.conf, going up to about 1h 20mins if I use -j1.

To me, it does sound like you're still building quite a generic kernel though. Stripping down with the tools suggested should cut down the build time quite a bit.

Thanks for the suggestion, will try if it improves building the next kernel. smile

So far going to test with ccache + tmpfs and the -j4 flag.

Offline

#13 2015-08-03 19:29:57

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: Compiling kernels take a lot of time

beta990 wrote:
clfarron4 wrote:

My i3-2370M processor builds the generic kernels I maintain in 45 minutes, using the -j4 flag in /etc/makepkg.conf, going up to about 1h 20mins if I use -j1.

To me, it does sound like you're still building quite a generic kernel though. Stripping down with the tools suggested should cut down the build time quite a bit.

Thanks for the suggestion, will try if it improves building the next kernel. smile

So far going to test with ccache + tmpfs and the -j4 flag.

-j4 flag will do "wonders"
I run my 4790K with HT with ="-j9"
Works like charm, as stated.


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#14 2015-08-09 15:47:37

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: Compiling kernels take a lot of time

Thanks guys for all the tips. big_smile

Results:
- Build time has been reduced to max. 30/20 mins. for my desktop and Intel i3 NAS (tmpfs)
- Build time for my NAS has been reduced with only one hour (a simple dual-core 1Ghz AMD fusion!)

By disabling unneeded modules (modprobed-db), using ccache, adding -j2/4 to make flags, .. I'm happy with the new changes. smile

Offline

Board footer

Powered by FluxBB