Click to See Complete Forum and Search --> : Why compile? I have RPM's
jlangley
11-16-2000, 06:51 PM
Basically this is a system optimization question.
Most RPM's are based on 386 arch.
1. Do Most makefiles find out weather your system is a pentium and compile it accordingly?
2. Do you "see" a speed difference?
e.g. OpenOffice and Linux Kernel and Gimp
SYSTEM STUFF- K6/2 300 32MB used for desktop stuff and backup webserver.
SlCKB0Y
11-16-2000, 07:15 PM
I think the answer is yes, a lot of programs if not all will compile for 686.
Unlike what Linux Mandrake would have you believe, most people say you wont see any or much noticeable difference from a pentium optimised/compiled program.
RPMS also OFTEN dont even work at all.
Goughmezz
11-16-2000, 09:29 PM
Zip files do work though. Every time. http://www.linuxnewbie.org/ubb/smile.gif
SubPar
11-16-2000, 09:42 PM
By default, there will be no optimizations when you compile a program from source. However, this is what I do with my Pentium 2: Before I compile a package, I run the following commands:
export CFLAGS='-O3 -march=pentiumpro -mpentiumpro'
export CXXFLAGS=$CFLAGS
Any program that has been decently setup to use autoconf and automake in the installation process will automatically add those flags to the makefiles. CFLAGS applies to C programs and CXXFLAGS is for C++. Note: Not all programs will work right with optimizations.
Unruly
11-16-2000, 10:58 PM
Originally posted by Goughmezz:
Zip files do work though. Every time. http://www.linuxnewbie.org/ubb/smile.gif
What the hell is your problem?? I mean, are you completely ignorant to everything outside your little bubble of microsoft "security" (a contradiction in itself) to believe that zip files on a 100% basis are ALWAYS working... hmm? have you ever heard of a bad crc?
Jeeze! I mean, zipfiles aren't even comparable to rpms, what kind of pathetic attempt at a semblance of intellegence was that?
You've been trolling this board with your completely off base and untrue M$ speak... isn't it time to move on and go to someplace else? Like.. ermm... #l33td00dzh4x0ring ? I'm sure that'd be more suitable and accepting of your kind... if you even know what IRC is...
Not really related to your question, but...
some of the really bleeding-edge programs need to be compiled for your particular software/hardware setup to work correctly/efficiently. An example of this is xawtv. To use the new video4linux extention of XFree86 4 xawtv needs to be compiled on a system with the new xlibs installed, and the newer .deb's (striving for compatability) aren't going to have this feature compiled in. This is one example of the benefit of open-source software (not necessarily Free software).
stiles
11-16-2000, 11:54 PM
Originally posted by SlCKB0Y:
I think the answer is yes, a lot of programs if not all will compile for 686.
Unlike what Linux Mandrake would have you believe, most people say you wont see any or much noticeable difference from a pentium optimised/compiled program.
Not to pick on you or anything SlCKBOY, but I'm going to use your answer to go a bit further into this issue.
Optimization has nothing to do with the source but has everything to do with the compiler (at least what we are talking about right now). Using compiler tags, or alternative compilers to optmize your binary has a trade off. The more your binary is optmized (for your processor) the larger the binary. Yes there is a real performance difference of the optmized binary (in the order of ~10% to as much as 40% (very rare to see this but in some operations you will see spikes like this, the mean is ~10% though)). The trade off is that you use more memory space (remember the larger binary). So how many apps really need optmizations? Does ls need to be optmized, I don't think so. How about cp, maybe if you call it from a cron job often but more than likely no. Your webserver? Maybe, if your not memory limited (what if you have a 900 athlon with 32MB of ram, the larger but more effecient apache kernel may hurt you more than help in that situation).
jlangley
11-17-2000, 02:35 PM
Thanks this really cleared things up for me
These are all good replies (except for that zip thing. BTW the term for the tgz or tar.gz files in Linux is TARBALL.)
I did have a question about CFLAGS. Are the CFLAGS are just stored as an environment variable? or do you have to change it in the Makefile? where can I get a listing of CFLAGS?
(basically what does "export" do. sorry I have to ask but there was no "man" file on any of it.)
chadm1967
11-17-2000, 03:07 PM
Thanks for bringing this subject up, jlangley. I've been wondering about that.
This post helped clear up a lot of my questions.
http://www.linuxnewbie.org/ubb/smile.gif
stiles
11-17-2000, 07:09 PM
Yes you can set up your CFLAGS as an environment variable (I still think that you have to call egcs or pgcc though, but I could be wrong), but I forget how. I usualy do the following (for a 686):
---------------------------------------
CC="egcs" \
CFLAGS="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions" \
./configure \
--<whatever eles I need here>
------------------------------------------
This (http://linuxdoc.org/links/p_books.html#securing_linux) book has a chapter about CFLAGS / optimizations
This (http://www.aboutlinux.com/art_k7-linux2_a.html) is an old compairson of drake 6.1 and RH 6 including benchmarks
This (http://www.aboutlinux.com/art_k7opt1_a.html) article benchmarks the Athlon with different CFLAGS
The (http://www.goof.com/pcg/) home of pgcc
henryst
11-18-2000, 03:10 PM
No offense, but I think command-line-commandoes got it all wrong that RPM's hardly ever work. I've never had a problem with RPM's. If you get a failed dependency, you just install it. EVERY SINGLE TIME I try to compile something I get errors. And a normal user can't go around editing source code each time he wants to install something. Hell atleast if it told what the compile problem was it wouldn't even be so bad.
And yes, I know exactly what the problem is. CLD's(see above) install all the source & compile stuff so compiling stuff is bound to work, yet your bound to get failed dependencies in an RPM, because you'd have to install through RPM to satisfy them. Since I always install by RPM...they always work. Heck, I don't want to have the sources or even headers all over my computer, when I just want to get some work done(it's okay if you're a programmer, because programming that is what you want to get done).
jlangley
11-18-2000, 06:40 PM
I use RH7. I have had little problems with RPM's (not to say that I have never had any, in fact I have--nothing to do with the Redhat distro). But I would still like my computer to GO... Java based programs run my computer into the ground. I want something better (than windows at least). I was just wondering if I could get more speed out of compiling programs than taking what I am given.
This would give me one more advantage that I didn't have with Microsoft. (Microsoft doesn't optomize itself for my specific architechure either.)
I am not talking about every program (unless there is a scalable way to do that--possibly through the SRPM's--I don't know) But for right now just taking the one's that I want to optimize. Mainly OpenOffice, Netscape/Mozilla, and the Kernel.
--------------5 MIN LATER--------------
During the writing of this message I went though and checked on that suggestion of the scalable way to do this. Could someone shed a little light on the BUILD OPTIONS in rpm man files? Is that a way to build the actual .rpm file or does that enable you to take the source rpm and build it for your system? (they even mention target architechures and such).
SlCKB0Y
11-18-2000, 10:02 PM
Originally posted by stiles:
Not to pick on you or anything SlCKBOY, but I'm going to use your answer to go a bit further into this issue.
Optimization has nothing to do with the source but has everything to do with the compiler (at least what we are talking about right now). Using compiler tags, or alternative compilers to optmize your binary has a trade off. The more your binary is optmized (for your processor) the larger the binary. Yes there is a real performance difference of the optmized binary (in the order of ~10% to as much as 40% (very rare to see this but in some operations you will see spikes like this, the mean is ~10% though)). The trade off is that you use more memory space (remember the larger binary). So how many apps really need optmizations? Does ls need to be optmized, I don't think so. How about cp, maybe if you call it from a cron job often but more than likely no. Your webserver? Maybe, if your not memory limited (what if you have a 900 athlon with 32MB of ram, the larger but more effecient apache kernel may hurt you more than help in that situation).
WOW...thats cool, i never knew that!
*runs off to ./configure, make, make install everything again*
lol