LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Compiling for Speed? - where does Ubuntu keep the options? (https://www.linuxquestions.org/questions/ubuntu-63/compiling-for-speed-where-does-ubuntu-keep-the-options-779463/)

GTrax 01-02-2010 04:39 PM

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.

MS3FGX 01-02-2010 06:32 PM

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.

GTrax 01-03-2010 03:35 AM

Quote:

Originally Posted by MS3FGX (Post 3811968)
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.

tommcd 01-03-2010 10:18 AM

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.

Arup65 01-12-2010 07:29 AM

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/


All times are GMT -5. The time now is 06:10 PM.