LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Is there a way to speed up slackbuilds? (http://www.linuxquestions.org/questions/slackware-14/is-there-a-way-to-speed-up-slackbuilds-887355/)

george-lappies 06-20-2011 12:08 PM

Is there a way to speed up slackbuilds?
 
Currently slackbuilds only uses one core while it is compiling. Is there a way to enable more cores?

jostber 06-20-2011 12:26 PM

Go into the SlackBuild script and add "-j4" to the make command if it is not there already.

audriusk 06-20-2011 12:27 PM

I have the following variables exported in my .bashrc:

Code:

# Set the number according to how many cores you have.
export JOBS=2
export MAKEFLAGS="-j2"

MAKEFLAGS is used by make, but some apps use different build systems, and in some SlackBuilds (notably for VirtualBox) JOBS variable is used instead.

bassplayer69 06-20-2011 12:29 PM

You can see about exporting MAKEFLAGS:

Code:

export MAKEFLAGS='-j 2'
or modifying the SlackBuild script and add -j2 to the make command.

The -j2 tells the make program how many processors are available. My examples are for a Core2Duo processor.

You'll have to read up on the compiling howto to see if this is ok to do though. Some applications don't like it.


WOW: both people above type faster than me! :)

55020 06-20-2011 12:30 PM

As others have said,
Code:

export MAKEFLAGS="-j2"
before you run sbopkg or an SlackBuild, but BEWARE! Some of them (very few) *will* go horribly wrong when you do this [1]. The usual way this shows up is a mysterious "file not found" error at the linking stage. To get round it, just
Code:

unset MAKEFLAGS
for the problem SlackBuilds.

[1] including (but not limited to) gsm, gsoap, john.

Edit: I think cmake uses MAKEFLAGS ok :-)

sahko 06-20-2011 01:16 PM

Quote:

Originally Posted by 55020 (Post 4390891)
As others have said,
Code:

export MAKEFLAGS="-j2"
before you run sbopkg or an SlackBuild, but BEWARE! Some of them (very few) *will* go horribly wrong when you do this [1]. The usual way this shows up is a mysterious "file not found" error at the linking stage. To get round it, just
Code:

unset MAKEFLAGS
for the problem SlackBuilds.

[1] including (but not limited to) gsm, gsoap, john.

Edit: I think cmake uses MAKEFLAGS ok :-)

MPlayer devs dont recommend or support anything other than j1 either

george-lappies 06-20-2011 01:17 PM

Great, thanks for all the replies. My MAKEFLAGS is set now. If I do
Code:

export MAKEFLAGS="-j2"
will it be persistant over reboots?

dimm0k 06-20-2011 01:28 PM

Quote:

Originally Posted by george-lappies (Post 4390920)
Great, thanks for all the replies. My MAKEFLAGS is set now. If I do
Code:

export MAKEFLAGS="-j2"
will it be persistant over reboots?

To make it persistent, you'll need to stick that either in your ~/.bash_profile or ~/.bashrc

bgeddy 06-20-2011 01:29 PM

Quote:

will it be persistant over reboots?
No - you need to add the 'export MAKEFLAGS="-j2"' to your ~/.bashrc or better still put it in /etc/profile so it's set for all users.

gnashley 06-20-2011 01:44 PM

Adding '-pipe' to your CFLAGS will help.


All times are GMT -5. The time now is 06:13 AM.