LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-02-2010, 04:39 PM   #1
GTrax
Member
 
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 258

Rep: Reputation: 37
Compiling for Speed? - where does Ubuntu keep the options?


Its about CFLAGS and -O2, and options like -march=<your architecture>.
There are things I am just not sure about.

eg - this PC has a Intel i7, which has a wealth of powerful instructions developed since 'i386', that the gcc complier might be able to compile for - if we tell it!

Where are the default options kept?

Even supposing one decides not to mess with Ubuntu defaults, how does one locally compile a program, optimized for the CPU, overriding the defaults?

How does one even tell if the 64-bit version got installed? In my case, it was provided by others.

My apologies if this seems a bit basic, but clicking System -> About Ubuntu can be surprisingly opaque on this little detail, even though you get the chance to choose at the site.
 
Old 01-02-2010, 06:32 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Ubuntu is a binary distribution, and in fact goes out of it's way to avoid the end user ever having to compile anything themselves. Not to say that you can't recompile things in Ubuntu with processor-specific optimizations, but that it really wouldn't work out as well as it could or should.

If you are serious about optimizing for your local hardware, you would be better off using a distribution that is ideally source based (like Gentoo), or at the very least is leaner to start with and gives you more control over building your own packages (like Slackware, Arch, etc).

You should also recompile your kernel with leaner options and targeted to your unique hardware configuration. This alone would net you a better performance boost than you are likely to get recompiling all your individual packages.
 
Old 01-03-2010, 03:35 AM   #3
GTrax
Member
 
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 258

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by MS3FGX View Post
You should also recompile your kernel with leaner options and targeted to your unique hardware configuration. This alone would net you a better performance boost than you are likely to get recompiling all your individual packages.
My thanks MS3FGX.
I have once had a (not very competent, it must be said), adventure with Gentoo, which I do not regret at all, even though I eventually got seduced into the joys of Ubuntu. Gentoo has /etc/make.conf where compile control is kept.

I was thinking to choose (force??) the compile options at least for those programs I was compiling myself. From what you say, it seems a more flexible distro is a better option.

This is only partly about needing the performance (which I do). It is also about not simply ignoring the utility of all the expensively developed architectures, powerful pipelined instructions and suchlike so we can have a kernel that will even run on a 486.
 
Old 01-03-2010, 10:18 AM   #4
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
There are several options for compiling a kernel in Ubuntu. For the manual method see this:
http://howtoforge.com/kernel_compilation_ubuntu
There are pre-compiled kernels for Ubuntu available here:
http://kernel.ubuntu.com/~kernel-ppa/mainline/
Then there is kernel-check:
http://www.ubuntugeek.com/automatica...in-ubuntu.html
You seem to know your way around the kernel config. I don't know if these options would be of interest to you.. I just thought I would mention these options in case you, or anyone else, was interested.

Last edited by tommcd; 01-03-2010 at 10:20 AM.
 
Old 01-12-2010, 07:29 AM   #5
Arup65
LQ Newbie
 
Registered: Jul 2009
Posts: 18

Rep: Reputation: 1
Check Linux for a comparison between a highly optimized Gentoo kernel and Ubuntu, lets say that the Gentoo didn't exactly run away with the benchmarks, few tests it did well but not spectacular compared to Ubuntu, on other tests it was dead even.

http://www.linux-mag.com/id/7574/1/

Last edited by Arup65; 01-12-2010 at 07:34 AM.
 
  


Reply



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
kernel compiling options slinky2004 Linux - General 6 10-10-2005 07:46 PM
compiling perl with c options fobius Slackware 1 10-06-2004 09:05 PM
Compiling ip_queue with other options? Jimbo Mahoney Linux - General 1 06-08-2003 05:17 PM
Kernel Compiling options moger Linux - General 1 09-26-2002 10:28 PM
Help compiling kernel with scsi options... mavness Linux - General 1 08-23-2002 07:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration