LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2002, 05:14 PM   #1
RedHatMN
Member
 
Registered: Mar 2001
Distribution: RedHat 9
Posts: 110

Rep: Reputation: 15
Compiling Vs. RPM's


OK, I've been a Red Hat Linux user for about the last 2 years, and am now looking for an alternative to RPM. So far, the top candidate I've found is Gentoo. Now the major difference between the two is that Red Hat is RPM-based while Gentoo is Source-based. What I've heard from everyone is that compiling from source significantly improves performance, and while I'm 99% sure this is true, I'm wondering why compiling it on your PC makes programs run faster than if they were complied on someone else's PC. Now, I'm looking for a CompSci answer to this. If someone could please enlighten me as to the advantages of compiling from source, besides not living in RPM hell, and give me a good explination of why compiling locally is better I'd much appreciate it, Thanks!

Aaron
 
Old 06-17-2002, 05:59 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
The compiler goes thru several steps when it compiles the program, one of them is optimization for a given architecture, so for example you got an rpm compiled for i686 and you use athlon processor it means that the prog was compiled for pentium pro and newer CPU (PII, PIII, etc), and hence it won't take advantages of additional instruction sets found on Athlon architecture, so when you compile from source the architecture of your system is considered during compilation (optimization step), so you can get full advantage of your processor.
 
Old 06-18-2002, 01:37 AM   #3
tundra
Member
 
Registered: Jun 2002
Location: Koom Valley
Distribution: rh8
Posts: 528

Rep: Reputation: 31
wow neo. that was neat and concise.
so this means that windows programs are not optimized? they just come with the executables after all...
 
Old 06-18-2002, 09:13 AM   #4
RedHatMN
Member
 
Registered: Mar 2001
Distribution: RedHat 9
Posts: 110

Original Poster
Rep: Reputation: 15
OK, so what if the rpm IS compiled for your architecture, then is there still an advantage to local compilation?
 
Old 06-18-2002, 11:25 AM   #5
tundra
Member
 
Registered: Jun 2002
Location: Koom Valley
Distribution: rh8
Posts: 528

Rep: Reputation: 31
yes, do tell... i'd love to know...
 
Old 06-18-2002, 12:46 PM   #6
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Yes, of course, there is take for example i386 architecture which is a generalization of all intel architectures, you get the rpm compiled for i386 machine and it works fine under you PentiumII and Athlon what it means it was compiled with SSE and 3DNow! just to pick a few, hence why would you need SSE instruction set compiled support on Athlon architecture? Here comes advantage of compiling yourself. Another thing SMP (Symmetric Multi-Processing)/UP(Uni-processing) - think for a moment, the apps that take full advantage of SMP don't run the same on UP architecture, so if you got an i386 rpm cmpiled on UP machine (and you know this sort of app can take a full power of your SMP machine) and you are installing it on SMP you won't gain any performance boost - compile yourself and you got full SMP support. Opposite hold true for UPvsSMP - you have UP machine and you are thinking that getting SMP package will boost the performance - it won't and you can miss on a few features that UP does better - compile yourself and you got the full UP support for your particular architecture, of course only if an app you are compiling includes special features available only on UP architecture.
 
Old 06-18-2002, 02:22 PM   #7
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
There's a method to have programs compiled for your architecture and still have the possibility to install/deinstall software easily. It's .src.rpm.
 
Old 06-18-2002, 02:28 PM   #8
RedHatMN
Member
 
Registered: Mar 2001
Distribution: RedHat 9
Posts: 110

Original Poster
Rep: Reputation: 15
OK, so you've showed me how it improves performance by optimizing programs for your CPU, but does it affect any other hardware? Take for example a GPU on Video Card, does compiling X, Gnome, etc... provide any additional improvement in performance, or is it strictly limited to your CPU?
 
Old 06-18-2002, 10:11 PM   #9
tundra
Member
 
Registered: Jun 2002
Location: Koom Valley
Distribution: rh8
Posts: 528

Rep: Reputation: 31
and while we're at it, how can we tell how much performance boost we're likely to get?

Last edited by tundra; 06-18-2002 at 10:12 PM.
 
Old 06-18-2002, 10:30 PM   #10
X11
Member
 
Registered: Dec 2001
Location: Brisie, Australia
Distribution: Slackware 8.1
Posts: 324

Rep: Reputation: 30
Quote:
Originally posted by RedHatMN
OK, so you've showed me how it improves performance by optimizing programs for your CPU, but does it affect any other hardware?
AFAIK, the performance is limited to the CPU because I don't know of any compilers that can optimise programs to take advantage of any other hardware.
Quote:
Originally posted by RedHatMN
Take for example a GPU on Video Card, does compiling X, Gnome, etc... provide any additional improvement in performance, or is it strictly limited to your CPU?
Optimised drivers should do that.
 
Old 06-18-2002, 11:18 PM   #11
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Quote:
There's a method to have programs compiled for your architecture and still have the possibility to install/deinstall software easily. It's .src.rpm.
You compile it yourself when you do rpm --rebuild watch the screen - you will see lots of gcc/cc statements - meaning you compile it and wrapping it into rpm afterwards, the only thing stays mistery for me why it always compiles into i386, I guess I'll have to look at it closely.
 
Old 06-19-2002, 03:13 AM   #12
tundra
Member
 
Registered: Jun 2002
Location: Koom Valley
Distribution: rh8
Posts: 528

Rep: Reputation: 31
so rpms are just packaged pre-compiled static executables optimised for the 386?
 
Old 06-19-2002, 03:35 AM   #13
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Basically yes, they are pre-compiled unless they are source rpms (src.rpm), as far as architecture concerned there are rpms available for many architectures from intel to alpha. RISC architecture and a few others are not supported by rpm though.
There are also available dynamically linked rpms e.g opera.

Last edited by neo77777; 06-19-2002 at 03:37 AM.
 
Old 06-19-2002, 09:06 AM   #14
jglen490
Member
 
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 8.04
Posts: 668

Rep: Reputation: 31
Compiling just for the sake of compiling may make you feel better about your situation, but is generally not going to make a noticeable difference on every piece of software. If done incorrectly, say with the kernel, compiling will in fact make your situation worse. Study what you have, understand what features need to be compiled in or optimized (if you know or learn how to do that), and then and only then take the time to do it -- if it's necessary.

If your distro or a specific package only works by compiling source, then do it, otherwise it should be the exception rather than a hard and fast rule.
 
Old 06-19-2002, 09:56 AM   #15
annehoog
Member
 
Registered: Jan 2002
Location: Nederland
Distribution: RH 8 Psyche and Debian Woody
Posts: 373

Rep: Reputation: 30
rpms vs compiling

please notice that with programs such as xine, ogle and mplayer (which are media/dvd players) it does really matter whether you use rpms or compile yourself.
Such programs are build against the kernels and should be optimized specificaly for your system. There are rpms available, but in my experience performance is never optimal. Xine e.g. crashes a lot!

Same goes for drivers that come with things like winmodems.

Anne
 
  


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
Are source RPM's and binary RPM's installed the same way? Simon Adebisi Linux - Software 3 06-28-2005 04:45 AM
Compiling Athlon RPM's SpEcIeS Linux - General 2 04-28-2005 10:56 AM
RPM's cleekjc Linux - Newbie 1 07-29-2003 05:50 PM
RPM's... AquamaN Linux - Software 3 07-29-2003 01:43 PM
What to do with rpm's flashingcurser Slackware 2 05-27-2003 04:08 PM


All times are GMT -5. The time now is 10:48 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration