LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Compiling very slow (http://www.linuxquestions.org/questions/slackware-14/compiling-very-slow-4175430714/)

r.vaillancourt 10-05-2012 01:29 PM

Compiling very slow
 
Just installed slackware 14, switched to the generic-3.2.29 kernel and recompiled the kernel using generic-config per Alien Bob's instructions. Compiling the kernel TOOK 4 1/2 HRS. Tried searching here and google not much help, mostly very outdated info. any help will be appreciated.

animeresistance 10-05-2012 01:44 PM

Hmmm ...

I think it is kinda weird ... i think that one of the most heaviest thing to compile is the kernel. I used to compile it in 6 hours (of course it was an old bones P3 with 1 GB in ram (it's still working)). So i think it is normal, unless you have a great machine and a great processor with too much RAM.

But i could be wrong.

T3slider 10-05-2012 01:48 PM

Since your CPU has two cores, you may get some speed gains by passing "-j3" to make, as in
Code:

make -j3 bzImage modules
A kernel compile takes a long time, and while it doesn't take 4.5 hours here on a desktop AMD Phenom II X4 processor with 4 cores, I can imagine a laptop APU with two cores would take a bit of time. You can try compiling on a tmpfs partition to minimize disk I/O, though I am unsure if 4 GB of RAM would be enough to hold the source and provide enough RAM for the compile without falling to swap (it may be, I'm just unsure). If you didn't parallelize make the first time then you should definitely see *some* speed gains with the above-mentioned -j3, anyway.

r.vaillancourt 10-05-2012 02:43 PM

...
 
Thanks guys. I'll def. try passing -j3. for this compile.

business_kid 10-05-2012 02:51 PM

I recompiled 3.2.29 and it took me about 16 minutes on a twin core 2Ghz turion cpu w/3G ram.

I have had the slow kernel compile problem with slamd64. It transpired the original (2.6.33?) kernel had every 32 bit bugfix, and no 64 bit acceleration compiled in. I emailed Fred Emmot and earnestly suggested forking the kernel and he obliged, which reduced kernel compile time to 15 minutes.

You are not compiling every module for every card ever built, are you? Just what's in the box? You have memory, and swap in abundance? No strange bootup messages?

r.vaillancourt 10-05-2012 04:15 PM

...
 
Quote:

Originally Posted by business_kid (Post 4798274)
You are not compiling every module for every card ever built, are you?
Just what's in the box?
You have memory, and swap in abundance?
No strange bootup messages?

Using the generic-config out of the box.

System specs in signature.

4GB mem 8GB swap.

I don't think so, need to check dmesg though. Screen goes blank for a few seconds when booting up
but thats about it other than the system seems a bit slugish

GazL 10-05-2012 05:53 PM

3.2.30 built on 3.2.29 using Pat's 'generic' config

x86_64 Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz

real 33m44.698s
user 56m57.314s
sys 6m35.024s


Make -j2 is enough to keep both cpu's pegged at 100% as I build in /tmp (tmpfs) and there isn't any i/o wait to speak of.

You can probably knock off a minute though as my script also runs a makepkg on it, which adds a little time.

r.vaillancourt 10-05-2012 11:41 PM

Thanks
 
Thanks guys, -j3 cut the compile time down to 2hrs. 15min.. Now to figure out which modules I can live w/o. :)
Its been a couple of minutes since I last played with Slack (10.2 I believe).
Appreciate the quick responses guys. Take care.

ReaperX7 10-06-2012 01:35 AM

There are several things you can do to speed up a kernel compile but not much realistically.

"make -jX" flags are one of the most common but you can also try increasing the stack using "ulimit -s XXXXX" with a value like 32768 or another multiple thereof. This won't cut it down dramatically in time though. In fact it might only shave off a few seconds.

Really, your CPU's overall power and cores will determine how well this works.

Also, when using the make -jX flag only set the #X amount equal to the number of cores you have. If you go over even by one you'll end up with make using the swap more and more.

If you want to know how long it will take visit the LFS project's page and see their Standard Build Unit (SBU) calculation.

1 SBU is equal to about 15 minutes on a Dual-Core 2.5 GHz AMD Athlon X2 CPU with 4GB RAM with the make -j2 flag enabled. The kernel takes at LEAST up to 5 times this amount to completely build. Calculate that out against a slower CPU, even with more cores and more RAM, and it will vary.

r.vaillancourt 10-06-2012 02:16 AM

Quote:

Originally Posted by ReaperX7 (Post 4798575)
There are several things you can do to speed up a kernel compile but not much realistically.

"make -jX" flags are one of the most common but you can also try increasing the stack using "ulimit -s XXXXX" with a value like 32768 or another multiple thereof. This won't cut it down dramatically in time though. In fact it might only shave off a few seconds.

Really, your CPU's overall power and cores will determine how well this works.

Also, when using the make -jX flag only set the #X amount equal to the number of cores you have. If you go over even by one you'll end up with make using the swap more and more.

If you want to know how long it will take visit the LFS project's page and see their Standard Build Unit (SBU) calculation.

1 SBU is equal to about 15 minutes on a Dual-Core 2.5 GHz AMD Athlon X2 CPU with 4GB RAM with the make -j2 flag enabled. The kernel takes at LEAST up to 5 times this amount to completely build. Calculate that out against a slower CPU, even with more cores and more RAM, and it will vary.

1hr. 15min. is a little more tolerable, but I'm not putting all my eggs in that basket (1900Mhz x2). Would be nice though.
I will look into the LFS SBU.

business_kid 10-06-2012 04:27 AM

On paper, you and I have fairly similar boxes (AMD cpu, chipset, graphics). My time was for the command
time make
which does the bulk of the work. If you're up over the hour, something's wrong. I have a 667Mhz bus (advertising spec) and a 7200 rpm drive (HP Compaq 6715S).

There's nothing major wrong with Pat's generic kernel, if you have an initrd. One possibility that springs to mind is that you don't have the chipset driver in there, and you're not getting full speed out of the disk. Try your speed with this command

sudo hdparm -tT /dev/sda

Mine does 755MB/s cached and 61.57MB/s direct. If yours is a lot off that, that could be the issue.

688a 10-06-2012 07:12 AM

Think about this, it takes me 1 and 1/2 hrs to slackbuild (I suppose it did compiling...) the browser chromium, so taking 4 hrs and more for a core system seems ok to me.



Btw, just curious, is your machine running faster after you built your own kernel?

TobiSGD 10-06-2012 08:23 AM

Quote:

Originally Posted by ReaperX7 (Post 4798575)
Also, when using the make -jX flag only set the #X amount equal to the number of cores you have. If you go over even by one you'll end up with make using the swap more and more.

I usually use -j10 on my 6-core machine (no Hyperthreading, compiling in RAM to make I/O a non-issue) and can't confirm that behavior.

H_TeXMeX_H 10-06-2012 08:26 AM

I also use -j with the number of cores I have mostly to be able to do other things while its compiling, like browsing the web, without major slowdown.

Martinus2u 10-06-2012 08:50 AM

Quote:

Originally Posted by r.vaillancourt (Post 4798531)
Thanks guys, -j3 cut the compile time down to 2hrs. 15min..

doesn't sound right to me. On my Core i7 systems it takes 1min 55s. With distcc I can do it in 1 min 10s. All this without slowing down my desktop activities due to scheduling class SCHED_IDLEPRIO. :D

If memory serves correctly, my pentium 3 machines used to to it in like 15 min, maybe a bit more. Admittedly I build custom kernels which are a lot smaller than distro kernels, but 2hrs 15min on a machine with two cores at 1900 MHz still doesn't sound right.


All times are GMT -5. The time now is 07:06 PM.