Hi guys,
I think it would be a good thing to add an option in gslapt and in sourcery for sayin' to the compiler the number of cpu, somethin' similar to -j5 ( for my quadcore ) for traditional shell.
What do you think about it? Is it possible for you?
Add an option for fast compiling
Re: Add an option for fast compiling
We already have that. Depending on the SLKBUILD or SlackBuild you are compiling this should work:
export numjobs=5
export NUMJOBS="-j5"
EDIT: You can add these lines to your /etc/bashrc
export numjobs=5
export NUMJOBS="-j5"
EDIT: You can add these lines to your /etc/bashrc
Re: Add an option for fast compiling
Good evening. What do you think about add this strings in profile or bashrc for next realese?thenktor wrote:We already have that. Depending on the SLKBUILD or SlackBuild you are compiling this should work:
export numjobs=5
export NUMJOBS="-j5"
EDIT: You can add these lines to your /etc/bashrc
MAX_CPU=`cat /sys/devices/system/cpu/kernel_max`
let "CPU=( MAX_CPU + 2 )"
export numjobs=$CPU
export NUMJOBS="-j$CPU"
Re: Add an option for fast compiling
This outputs 31 on my system? Would be way too much. It's probably up to every user himself to define this variables. Because some users may prefer low number for better interactivity and less loads, some take something in the middle and others (like me) tend to set quite high values to get a decent load onto their CPU or to make use of distcc.
At the other hand I'm not completely opposed to this. But this command would be the way to go:
I think it's the only solution which works properly on a wide variety of systems. I think it's also no good idea to run more parallel jobs than there are processors.
On a sidenote, some programs can't be built with multiple jobs. So this could introduce problems, although actually in this case the build script should just ignore the variable and default to one job.
At the other hand I'm not completely opposed to this. But this command would be the way to go:
Code: Select all
getconf _NPROCESSORS_ONLN
On a sidenote, some programs can't be built with multiple jobs. So this could introduce problems, although actually in this case the build script should just ignore the variable and default to one job.
Re: Add an option for fast compiling
Hi.
You right, all choose what preferring.
p.s. I prefer set to maximum, "sometimes waiting for a compilation like death". sorry, but i do not know how explain more literary language this sentence.
You right, all choose what preferring.
Very Interesting, some kind error? Two pc with salixos working correctly.This outputs 31 on my system?
Thanks, I didn`t knew this.Code: Select all
getconf _NPROCESSORS_ONLN
p.s. I prefer set to maximum, "sometimes waiting for a compilation like death". sorry, but i do not know how explain more literary language this sentence.
Re: Add an option for fast compiling
That's the maximum number supported by the running kernel. Not the number of cpus available or online. For that you would need to look at '/sys/devices/system/cpu/online'. But CPUs are listed in the form 0-3 (that's e.g. on a 4 processor system).coroner wrote:Very Interesting, some kind error? Two pc with salixos working correctly.This outputs 31 on my system?
BTW max_cpu also says 1 here on a dual-core 32bit system, but 31 on 64-bit quad-core system.