gcc compilation optimization (Intel Centrino)
Most often whenever we compile some packages, from the INSTALL or README file, we read the 3 simple line:
Quote:
the question is how to optimize the compilation for certain architecture ? for example, Intel Pentium Centrino ? |
Generally, when you first install your distro, it tells gcc to optimize stuff for your architecure.
For instance, on my Ubuntu, gcc automatically optimizes stuff for k7 (Athlon XP) instead of just 686 or 386. When you type make for installing something, watch the output and it should say something along the lines of --march=pentium4 Or something like that. |
hmm....for example,
Code:
#!/bin/sh The line, ARCH=${ARCH:-i486} what was that means? Sorry, I'm not a scripting guru..But I guess it's a subshell and defined as new variable for inside this script (correct me if I was wrong). Then followed by the, if...fi block Does modern computers should compile with i686 for both -march=i686 and -mcpu=i686 ? Also, how to categorize the Intel Centrino type (possible closed to Mobile)? i686 or mobile or any `cpu-type' name? |
Well, it will most likely compile against the 686 architecure. I'm not quite sure how to make it compile against P4, or if that will work on a Centrino.
|
Does 686 arch' covered all the recent Intel class precessors? with exceptional 64 bit cpu?
which means, Intel Mobile + Intel Mobile Centrino (Dothan) + Intel Mobile (Banias) + Intel Pentium 4 HT + possibly others also categorize in this category? |
hi,
go yo the manual for your version of gcc gcc-v here http://gcc.gnu.org/onlinedocs/ look under Hardware Models and Configurations -> Intel 386 and AMD x86-64 Options there you will find the proper setting for the modern compilers the proper setting for centrino is -march=pentium-m or -mtune=pentium-m all the older settings from pentium3 down to i386 will run on the centrino centrino is a small pentium3 so code compiled for pentium4 and above wont work you don't need -mcpu is old and does nothing now so hack that script and put SLKCFLAGS="-O2 -march=pentium-m" or if you want to be brave SLKCFLAGS="-O3 -march=pentium-m" and forget about it using those arch readings from the kernel for packages that don't use SLKFLAGS put this in your ~/.bashrc export CFLAGS='-O2 -march=pentium-m' export CXXFLAGS=$CFLAGS first time before you log in with the new file you can read it in with source ~/.bashrc it will get read automatically later and most packages will pick up the values if something doesn't work bacause of the optimizations unset CFLAGS unset CXXFLAGS and then do the configure again and you will get default optimizations |
Yep, do what foo_bar_foo said :p I was just guessing myself based on what Ubuntu does.
|
thanks a lot guys...VERY comprehensive posts..
|
All times are GMT -5. The time now is 05:27 PM. |