Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CFLAGS determination script
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Fri May 21, 2004 3:52 pm    Post subject: Reply with quote

vdboor wrote:
Thanks for this useful info :) I think this should be at the main page somewhere, because everyone seams to play _a lot_ with their flags.. Also, -fomit-framepointer and such are already used for -O2 ;)
My CFLAGS seam to get cleaner and shorter each month :P


Welcome :P
But beware - -O2 implies -fomit-frame-pointer, but only on machines where it wouldn't interfere with debugging. x86 (and x86-64 IIRC) machines do not fall into this category, so for your typical system -O2 doesn't imply -fomit-frame-pointer. This one's a keeper :)
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Sat May 22, 2004 11:30 pm    Post subject: Reply with quote

moocha wrote:
Do NOT use -ffast-math. You're asking for it.


I goofed badly on this one. I ran tests and it turns out -ffast-math is very good to use when also using optimization (i.e. for any Gentooer :D).
See my post in this thread for details.
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
metalh34d
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2004
Posts: 126

PostPosted: Tue May 25, 2004 7:35 am    Post subject: Reply with quote

I get these results:-march=pentium4 -mfpmath=sse -msse2 -mmmx

CPU Info as follows: (note that repeat is from hyperthreading not a second proccessor)

Code:
$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping        : 9
cpu MHz         : 2406.115
cache size      : 512 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips        : 4751.36

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping        : 9
cpu MHz         : 2406.115
cache size      : 512 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips        : 4800.51


CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer -ffast-math -fforce-addr -mfpmath=sse -msse2 -mmmx" is what I currently have setup now after using this script. Anyone constructive criticism by chance? I used to have -Os setup because the word was programs would load much faster but now I'm starting to hear that my P4's cache is so large Os won't matter so much and O2 is the best bang for the buck when comparing loadtime and performance increase between O2 and O3?
Back to top
View user's profile Send private message
dak1001
n00b
n00b


Joined: 16 Dec 2003
Posts: 9

PostPosted: Thu Aug 05, 2004 7:12 pm    Post subject: for fincoop, et. al. Reply with quote

fincoop - the portage package, as well as others, do have some hard coded GCC flags as intended by the developers... you can check this by looking at the associated "$package-$version.ebuild" file. this is likely why some of the things (portage in particular) you emerge'd did not use your CFLAGS from the /etc/make.conf

until the Pentium M processor is incorporated into the mainline GCC, i would say that this is a case where you would indeed want to use a "-m" flag, i.e., the Pentium M has a core much more similar (but not the same as) the Pentium III architecture and yet also takes advantage of SSE2, so:

CFLAGS="-pipe -O2 -march=pentium3 -fomit-frame-pointer -msse2"

could be a suitable setting, and in fact is exactly what i use on my DELL CENTRINO laptop.

earlier, someone made mention of the "-mfpmath=" flag... from my experience GENTOO'ing now, i have toyed with many different GCC flags and though i did witness some benefit in some apps, by and large, i saw a lot of problems going forward. that is, they compiled fine and executed perfectly. but when it came time to "emerge -u" the upgrade would fail. luckily, i always keep a box around with generic optimizations where i would have to compile the updated package and then use to upgrade my system. after too many times of messing with this, i now use a much safer combination, which is what i listed above.

but, your mileage will vary, so if you like to dabble and experiment, i suggest you do and find what works best for you.

Here is the GCC link with explanations on all of the optimizations.

http://gcc.gnu.org/onlinedocs/gcc-3.4.0/gcc/Optimize-Options.html#Optimize%20Options/
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Mon Nov 22, 2004 7:23 pm    Post subject: Reply with quote

Could anyone give me a link to the script? I can't get it to work per copy and paste...

cu
TheCurse
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum