LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-10-2013, 04:48 PM   #1
bmarley83
Member
 
Registered: Apr 2013
Location: Pennsylvania
Distribution: Slackware
Posts: 128

Rep: Reputation: 27
Compiling Speed


Hello, just signed up today and this is my first post, I hope it is in the right place. I have just started using Slackware last week and I have to say it is fantastic! After trying Ubuntu, Fedora, and Debian I have settled on Slackware and I'm quite pleased. It really seems to support the ideas and the structure of "old school" distributions from the 90's. I have had no crashes, and with help from Alien Bob (creating a multilib system) and slackbuilds.org, I have been able to get all my software not only up and running, but also running much smoother than any other distro, while learning many new things. Anyways enough jabbering! My question is related to compiling programs from source and specifically the speed of compilation. My PC specs are as follows; Intel Q9400 @ 3.2ghz, 6GB DDR2 800mhz, 3 1TB WD Black HD's, and a GTX260 sp216 896MB running the proprietary NVIDIA driver 310.44. When compiling programs from source I notice I am using only one core. I am actually compiling wine in a terminal as I type this. It is hoping from core to core and using 80-100% of that core while compiling. Can I make gcc, or what ever library is used to compile programs, use more than 1 core in order to compile things more quickly, and is there any way to optimize this process? Wine has now been compiling for more than 30 minutes. I'm not in any rush, just want it to be faster and use my system optimally. Can anyone help me?
 
Old 04-10-2013, 04:50 PM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 2,493

Rep: Reputation: 403Reputation: 403Reputation: 403Reputation: 403Reputation: 403
use make -j <n> where n depends on your cores
 
Old 04-10-2013, 04:55 PM   #3
bmarley83
Member
 
Registered: Apr 2013
Location: Pennsylvania
Distribution: Slackware
Posts: 128

Original Poster
Rep: Reputation: 27
Thanks willysr! Damn that was quick! lol. Is there anyway I can automate that command so that whenever any script uses the make command it will use the defined number of cores automatically?
 
Old 04-10-2013, 04:58 PM   #4
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 853

Rep: Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658Reputation: 1658
I'm not aware of any way other than passing the -j option to make. By the way, I usually use n+1 or n+2 for better core utilization (especially if you have a decent amount of RAM). You'll probably cut 10% off the compile time that way.
 
Old 04-10-2013, 05:03 PM   #5
saulgoode
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 219

Rep: Reputation: 87
Quote:
Originally Posted by bmarley83 View Post
Thanks willysr! Damn that was quick! lol. Is there anyway I can automate that command so that whenever any script uses the make command it will use the defined number of cores automatically?
export MAKEFLAGS=" -j6"

(I add the command to my .bashrc)
 
1 members found this post helpful.
Old 04-10-2013, 05:04 PM   #6
bmarley83
Member
 
Registered: Apr 2013
Location: Pennsylvania
Distribution: Slackware
Posts: 128

Original Poster
Rep: Reputation: 27
Okay, so if wanted a particular script to use more cores I could go through it and replace the make with make -j 2 and it would work?

---------- Post added 04-10-13 at 05:05 PM ----------

thanks saulgoode! I am gonna try that now.
 
Old 04-10-2013, 05:12 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,357
Blog Entries: 2

Rep: Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980
You can either run a a Slackbuild manually with
Code:
MAKEFLAGS=" -j6" package.Slackbuild
if you want to use more than one core (replace the number with the appropriate number for your system, I use -j10 on my 6-core and -j3 on my 2-core), or you use the suggestion from saulgoode.

I do the latter for quite sopme time now and it works great. Be aware that some software will not compile when using more than one core (for example webkitgtk), but usually the package maintainer adds a
Code:
MAKEFLAGS=" -j1"
to those packages. I never had to manually edit a script for that.

Last edited by TobiSGD; 04-10-2013 at 05:45 PM.
 
1 members found this post helpful.
Old 04-10-2013, 05:42 PM   #8
bmarley83
Member
 
Registered: Apr 2013
Location: Pennsylvania
Distribution: Slackware
Posts: 128

Original Poster
Rep: Reputation: 27
You guys are awesome! Doing exactly what saulgoode said I am currently compiling chromium with the slackbuilds script with all four cores at 100% ! Thank you so much fellas this site is great, cant believe all the responses that came so quickly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling for Speed? - where does Ubuntu keep the options? GTrax Ubuntu 4 01-12-2010 07:29 AM
optimizing compiling for speed cryptopodium Linux - Software 7 06-09-2006 03:48 AM
Compiling speed increased by ramdrive? exodist Linux - Software 1 07-31-2004 10:16 AM
cdrecord - trying to use high speed medium on low speed writer captain-cat Linux - Hardware 2 07-12-2004 06:27 PM
Is there a tool to monitor Internet connection speed and also network speed? xleft4dexy Linux - Networking 4 10-14-2003 10:29 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration