You are not logged in.

#1 2008-03-23 18:57:54

kayrune
Member
Registered: 2007-12-15
Posts: 43

compile packages yourself with dual/quad core

I'm compiling some packages and svn myself and I'm wondering, why 'make' only use one of the 4 cores on the cpu ? is there som way to make it use all four ? I'd assume compiling would be a lot faster.

Offline

#2 2008-03-23 19:34:00

kappa
Member
Registered: 2006-11-10
Posts: 26

Re: compile packages yourself with dual/quad core

Make's "-j" option controls how many jobs make can execute at the same time. Makepkg defaults to -j 2 (set under MAKEFLAGS in /etc/makepkg.conf ).

Offline

#3 2008-03-23 19:47:49

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: compile packages yourself with dual/quad core

This can break some software from compiling, and it will fail without warning.

Offline

#4 2008-03-23 20:51:04

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: compile packages yourself with dual/quad core

Yeah, some argue that '-j 3' is fine, but many have come across problems with anything but the default '-j 2 'which happens to be very safe.


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#5 2008-03-23 21:39:18

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: compile packages yourself with dual/quad core

I personally use -j3 for my SMP. I have not had a problem yet, though, it is widely perceived that -j2 is safest and I'm not arguing.

Offline

#6 2008-03-24 12:06:23

kappa
Member
Registered: 2006-11-10
Posts: 26

Re: compile packages yourself with dual/quad core

skottish wrote:

This can break some software from compiling, and it will fail without warning.

On multi-core systems this already happens with the default -j2. There one might have to explicitly set -j1 for some builds, but I have yet to see a program that would build with -j2 but not -j3 or -j4.

Offline

#7 2008-03-24 13:35:01

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: compile packages yourself with dual/quad core

-j5 on a Core 2 Duo is fine, while -j10 on a Quad works smile Well, at least according to some ricers.

-j1, for a case example, is required for compiling anything VST-related.

When you come across a build that fails with regards to job servers, take a look at the default makefile. Few will tell you that > make=-jn will not work. This was discussed to a little extent here.


I need real, proper pen and paper for this.

Offline

#8 2008-03-24 13:41:25

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

Re: compile packages yourself with dual/quad core

See race condition, for why 1 thread works, and >1 maybe won't.

Offline

Board footer

Powered by FluxBB