Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CFLAGS Central (Part 1)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 28, 29, 30 ... 35, 36, 37  Next  
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
seppe
Guru
Guru


Joined: 01 Sep 2003
Posts: 431
Location: Hove, Antwerp, Belgium

PostPosted: Wed Mar 17, 2004 4:17 pm    Post subject: Reply with quote

ok, thanks for your reaction ... I'll try those CFLAGS, but first I'll try to emerge binutils with these cflags, because I had problems before with binutils when I specified -freduce-all-givs.

If anyone thinks those CFLAG's ultraoctane.com gave are NOT good for my system for some reason, please tell me :)

I have also some other questions:
1) If I do an emerge -e world, can I stay in Gnome while it's recompiling my system? Or do I have to shut down Gnome and X completely and to the emerge -e world in my console?
2) How can I unmerge KDE with all his dependencies (which are not needed by other packages), because I don't use KDE anyway so I don't want to reëmerge it again.
3) If emerge -e world fails, can I resume succesfully with 'emerge --resume'? Has anyone have experience with this?
Thanks ;)
_________________
nitro-sources, because between stable and experimental there exists only speed

Latest release I made: 2.6.13.2-nitro1
Back to top
View user's profile Send private message
seppe
Guru
Guru


Joined: 01 Sep 2003
Posts: 431
Location: Hove, Antwerp, Belgium

PostPosted: Wed Mar 17, 2004 5:32 pm    Post subject: Reply with quote

some comments on the CFLAGS you suggested me:

Quote:
<shadows> seppe, those flags will break packages

Quote:
<kloeri|work> seppe: loose all the -f ones except -fomit-frame-pointer and possibly -ftracer

Quote:
<slarti`> seppe: -O3 seems excessive for a processor with 256kb cache, drop it down to -O2 or -Os

Quote:
<kloeri|work> seppe: most of those flags are redundant or will probably cause some form of instability down the road


8O
_________________
nitro-sources, because between stable and experimental there exists only speed

Latest release I made: 2.6.13.2-nitro1
Back to top
View user's profile Send private message
nmcsween
Guru
Guru


Joined: 12 Nov 2003
Posts: 381

PostPosted: Thu Mar 18, 2004 12:20 am    Post subject: Reply with quote

Remember these are HIGHLY optimized flags and some packages won't compile with them. You'll need to take out a flag or two to get some packages to compile, try this on compiles that fail -march=X -O2 -pipe -ftracer -fno-crossjumping -maccumulate-outgoing-args -fmove-all-movables -freduce-all-givs if it's still giving you problems then you know it has to do with one of the last three.


Quote:


Quote:
<shadows> seppe, those flags will break packages
Quote:
<kloeri|work> seppe: most of those flags are redundant or will probably cause some form of instability down the road

I've been running for near a full 5 months without a single crash and a average uptime of 2 weeks. As for the redundant part yes one is the -mfpmath=sse the rest are not.
Quote:

<slarti`> seppe: -O3 seems excessive for a processor with 256kb cache, drop it down to -O2 or -Os

256K cache should have nothing to do with how you customize your cflags it has to do with all the variables of the entire system in question (i.e a 486 should be compiled with -Os). Remember to customize YOUR system with it's bottlenecks in mind.
Back to top
View user's profile Send private message
seppe
Guru
Guru


Joined: 01 Sep 2003
Posts: 431
Location: Hove, Antwerp, Belgium

PostPosted: Thu Mar 18, 2004 8:40 am    Post subject: Reply with quote

Ok thanks,

I started the recompiling of my system yesterday and it's still going .. wish me luck ;)
_________________
nitro-sources, because between stable and experimental there exists only speed

Latest release I made: 2.6.13.2-nitro1
Back to top
View user's profile Send private message
carpman
Advocate
Advocate


Joined: 20 Jun 2002
Posts: 2202
Location: London - UK

PostPosted: Fri Mar 19, 2004 12:11 pm    Post subject: Reply with quote

Hello, can any tell me if the settings i have for my pentium 2 366 mobile are ok or can be improved, cheers.

-march=pentium2 -02 -pipe fomit-frame-pointer -mmmx - funroll-loops -fforce-addr
_________________
Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Back to top
View user's profile Send private message
MG-Cloud
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 200

PostPosted: Sun Mar 21, 2004 9:11 am    Post subject: Reply with quote

Hi,
From reading this thread (took *forever*), I've come up with the following cflags for my athlon-xp machine:

My current flags:
-march=athlon-xp
-mcpu=athlon-xp <- for ebuilds that strip -march
-O3
-pipe
-fomit-frame-pointer
-ftracer

Flags I plan on adding with a couple questions. Basically, the gist of my questions are - are these generally beneficial, or can they have detriments in a large number of applications as well? I dont' mind stability problems (eg re-emerging individual packages once in a while). I do however mind slowdowns that aren't immediately attributable to a certain cflag.

-funroll-loops
-fprefetch-loop-arrays

-mfpmath=387 (Big question here that I'd really like answered: Does this really speed things up on athlon xps? prior to reading this thread, it was my understanding that the sse instruction set included optimizations, and even if the athlonxp's sse implementation was less than optimal, it would still be faster than -mfpmath=387.)

-freduce-all-givs (heard this caused problems with binutils. is it okay now?)

Flags I may add, but am a little hesitant over. Eg - I've seen them mentioned once or twice in this thread, but have never really encountered them elsewhere. Any info about these would be great (I'm not too great with technical cpu details though, that's why i can't read the gcc manpages)

-fmove-all-movables
-fforce-addr

Thanks for any help! ^^
Back to top
View user's profile Send private message
MG-Cloud
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 200

PostPosted: Sun Mar 21, 2004 9:13 am    Post subject: Reply with quote

@carpman:
I'm a bit of a newbie here myself, so can't help you too much. Just wanted to point out one thing though - your cflags include -02. This is a typo - the correct option is -O2 (capital 'o'), not -02 (zero).

@seppe:
Good luck ! :)
Back to top
View user's profile Send private message
carpman
Advocate
Advocate


Joined: 20 Jun 2002
Posts: 2202
Location: London - UK

PostPosted: Sun Mar 21, 2004 3:36 pm    Post subject: Reply with quote

MG-Cloud wrote:
@carpman:
I'm a bit of a newbie here myself, so can't help you too much. Just wanted to point out one thing though - your cflags include -02. This is a typo - the correct option is -O2 (capital 'o'), not -02 (zero).

@seppe:
Good luck ! :)


Yep noticed that, ok in make.conf though :)
_________________
Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Back to top
View user's profile Send private message
seppe
Guru
Guru


Joined: 01 Sep 2003
Posts: 431
Location: Hove, Antwerp, Belgium

PostPosted: Sun Mar 21, 2004 4:26 pm    Post subject: Reply with quote

Well, it's still going (still something like 128 packages to go :)), I've had some problems with a few packages but changing lowering my cflags for those packages, compile them and resume with the more extreme cflags works like a charm.

Though, some packages broke and lowering my cflag's didn't work, but there is still 'emerge --resume --skipfirst' to skip those packages :) There was a problem with some assembler instructions, I think. But I wrote the packages' name down, and I'll try to compile them again when the rest is finished.

Also, I had problems with 'icc' in my use flags with some packages, but changing that to '-icc' did the job.

Mono gave me some problems too, but I think the compilation will succeed with less extreme cflags. But I do that later (so I used emerge --resume --skipfirst again), because I really want to finish the 'emerge -e world' as soon as possible.

Greetz and thanks again for the info ;)
_________________
nitro-sources, because between stable and experimental there exists only speed

Latest release I made: 2.6.13.2-nitro1
Back to top
View user's profile Send private message
seppe
Guru
Guru


Joined: 01 Sep 2003
Posts: 431
Location: Hove, Antwerp, Belgium

PostPosted: Mon Mar 22, 2004 12:48 pm    Post subject: Reply with quote

MG-Cloud wrote:
Hi,
-freduce-all-givs (heard this caused problems with binutils. is it okay now?)


Well, I tried to emerge binutils with -freduce-all-givs and it compiled without problems! But I think -freduce-all-givs *does* break up other things.
_________________
nitro-sources, because between stable and experimental there exists only speed

Latest release I made: 2.6.13.2-nitro1
Back to top
View user's profile Send private message
Gooberslot
n00b
n00b


Joined: 27 Apr 2003
Posts: 26

PostPosted: Sat Apr 10, 2004 10:23 am    Post subject: Reply with quote

I have a coppermine based Celeron and I was wondering if anyone had any suggestions for which cflags to use. Last time I tried installing Gentoo I used -march=pentium3 and -O3 and KDE wound up being very slow, much slower than the same version under Knoppix. I thought maybe -O3 was increasing the code size too much considering I only have a 128k cache and that maybe -O2 would be better. Any other options I should add?
Back to top
View user's profile Send private message
mahir
l33t
l33t


Joined: 05 Dec 2003
Posts: 725
Location: London

PostPosted: Fri Apr 16, 2004 2:58 am    Post subject: help, p4 3gz 512 ram, HT Reply with quote

hi all
i have been reading they 12 pages of the 29in this topic
and i cant go no futher


could someone help me with a quick cut/paste..


what would be the optimal settings for my system?
i got a p4 HT 3.06ghz system with 512 ram.


any ideas please?
_________________
"wa ma tawfiqi illah billah"
Mahir Sayar
Back to top
View user's profile Send private message
Andrej
n00b
n00b


Joined: 04 Oct 2003
Posts: 60
Location: Latvia

PostPosted: Fri Apr 16, 2004 4:42 am    Post subject: Reply with quote

I'm use -03 -pipi -fomit-frame-pointer. What Óflags can i add? System Celeron 1300
Back to top
View user's profile Send private message
nmcsween
Guru
Guru


Joined: 12 Nov 2003
Posts: 381

PostPosted: Fri Apr 16, 2004 5:03 am    Post subject: Reply with quote

Read
Run this program called acovea in simple terms it runs a few tests to figure out what will run best for your cpu ( takes about 48 hours ).
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Fri Apr 30, 2004 1:19 am    Post subject: What CFLAGS to use? Reply with quote

My current CFLAGS (have not had problems):
Quote:
$CFLAGS="-march=i686 -mcpu=i686 -O3 -fomit-frame-pointer"
$CXXFLAGS=$CFLAGS

My /proc/cpuinfo:
Quote:
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 4
model name : AMD Athlon(tm) processor
stepping : 2
cpu MHz : 1200.242
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow
bogomips : 2367.48
What should I use? Would
Code:
-mmmx -m3dnow -march=athlon -mcpu=athlon -Os   -pipe -fomit-frame-pointer
work? Is there a better option?
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Fri Apr 30, 2004 1:22 am    Post subject: Reply with quote

Yes - check out that thread you just started. Like I said, -O3 will be faster than -Os on your processor, as yours isn't a handheld, ARM, old PPC or SPARC, or 486 or earlier. Oh, I assume it's not an SMP system either. So -Os would be worthless for you.
_________________
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Back to top
View user's profile Send private message
nmcsween
Guru
Guru


Joined: 12 Nov 2003
Posts: 381

PostPosted: Thu May 06, 2004 5:45 am    Post subject: Reply with quote

I just thought I would post my current CFlags running gcc 3.4:
Code:
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer -finline-functions -finline-limit=200 -fweb -frename-registers -fmerge-all-constants
-ffast-math -ftracer -funit-at-a-time -fpeel-loops --param max-crossjump-edges=819200 --param max-delay-slot-insn-search=409600 --param max-gcse-passes=333
--param max-reload-search-insns=204800"

The global common sub expression elimination ( --param max-gcse-passes ) is overkill. Also it's rock stable and have only a few times had to lower my cflags for a package to compile.
Back to top
View user's profile Send private message
phex
n00b
n00b


Joined: 08 Jun 2002
Posts: 32

PostPosted: Tue May 25, 2004 8:41 am    Post subject: Reply with quote

my current cflags are
-march=athlon-xp -mcpu=athlon-xp -Os -pipe -fomit-frame-pointer -fforce-addr -ffast-math -ftracer -fprefetch-loop-arrays

havent noticed any problems going AWOL or crashing. Except for every now and then I might come across 1 or 2 apps that won't compile with the -ffast-math enabled. Other than that everything seems fine. I've been using them on my box for almost a year now. Also the option
-fprefetch-loop-arrays
is disabled at the -Os level. I usually may switch back to -O2 :)
--------
CPU
Athlon XP 2500+ OC'd @ 3200+
Back to top
View user's profile Send private message
kilrogg
n00b
n00b


Joined: 05 Mar 2004
Posts: 3
Location: Muenster, Germany

PostPosted: Tue May 25, 2004 11:39 am    Post subject: Reply with quote

-Os Level really only is for environments where code size is more important than speed as it optimizes binary size

I ran acovea on multiple computers (Pentium and AMD) and did speed tests with compiled applications such as LAME (mp3 encoder).

My optimized flags made LAME encode my reference MP3 in 10 seconds less time (2:21 -> 2:11). And i already did use the optimized flags described in gentoo install documentation.

I'm using the following flags:

-mcpu=athlon-xp -march=athlon-xp -pipe -O3 -ffast-math -maccumulate-outgoing-args -ftracer -funroll-loops -fprefetch-loop-arrays -fomit-frame-pointer

(-mmx, -m3dnow, etc. are automatically activated when using -O3)
For a complete help on gcc settings try 'man gcc'.

I encountered only 2 errors when recompiling my whole system (>500 packages) and I'm not sure they were compiler errors.

Whole system runs smoothly and very fast.
Back to top
View user's profile Send private message
thechris
Veteran
Veteran


Joined: 12 Oct 2003
Posts: 1203

PostPosted: Fri Jun 04, 2004 8:14 am    Post subject: Reply with quote

from what i've got so far on the athlon-xp:

-mfpmath=anything never comes up good, always neutral or bad. so leave this out.
-fomit-frame-pointer comes up equally good and bad...
-ftracer is good, but not overly so. never bad though.
-fprefetch-loop-arrays is usually very good, but in my experience, some programs don't like it...
-fstrict-aliasing came up very good as well.
-fstrength-reduce came up very good, and i think it's implied by -O2
-funroll-loops sadly came up mostly bad.
-fgcse also comes up as good.

right now i'm testing the aligning. so far:
-falign-functions=4
-falign-loops=1
-falign-jumps=4
-falign-labels=4

i suggest doing -O2 -finline-functions because some programs override -O3, and function inlining is usually better then worse.

and the things in -ffast-math usually help out as well.
Back to top
View user's profile Send private message
MrPixel
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2004
Posts: 117
Location: Here & Now

PostPosted: Thu Jun 24, 2004 9:37 pm    Post subject: Reply with quote

I just ran the ACOVEA huffman and tree benchmarks. They returned:
huffman:
Code:
optimistic options:
    -fno-crossjumping (1.693)
    -fcse-follow-jumps (1.493)
    -fcse-skip-blocks (1.293)
    -fexpensive-optimizations (1.773)
    -fforce-mem (1.493)
    -fschedule-insns2 (1.373)
    -freorder-blocks (1.053)
    -ftracer (1.453)
    -fnew-ra (1.053)
    -finline-limit (1.333)
pessimistic options:
    -fno-guess-branch-probability (-1.988)
    -fno-if-conversion (-1.988)
    -fgcse (-1.508)
    -fschedule-insns (-1.828)
    -fno-inline (-1.508)
    -funroll-loops (-1.267)
    -funroll-all-loops (-1.428)
    -mfpmath=387 (-1.948)
    -mfpmath=sse,387 (-1.988)
    -momit-leaf-frame-pointer (-1.628)
    -ffinite-math-only (-1.187)

tree:
Code:
optimistic options:
    -fno-thread-jumps (1.241)
    -fcse-follow-jumps (1.715)
    -fgcse (2.017)
    -frerun-cse-after-loop (1.715)
    -fcaller-saves (1.025)
    -fforce-mem (1.844)
    -fstrict-aliasing (2.276)
    -fsched-interblock (1.154)
    -fomit-frame-pointer (1.499)
pessimistic options:
    -fno-loop-optimize (-1.993)
    -fstrength-reduce (-1.691)
    -fschedule-insns (-1.001)
    -falign-labels (-1.088)
    -fprefetch-loop-arrays (-1.217)
    -fnew-ra (-1.691)
    -funroll-loops (-1.864)
    -funroll-all-loops (-2.036)
    -mfpmath=387 (-1.088)
    -mfpmath=sse (-1.691)
    -mfpmath=sse,387 (-1.131)
    -momit-leaf-frame-pointer (-1.648)


Based on this, I am considering adding the following to my CFLAGS, and just wanted to get some opinions/feedback/input before I do emerge -e world:
-fno-crossjumping
-fcse-follow-jumps
-fcse-skip-blocks
-frerun-cse-after-loop
-fforce-mem
-ftracer
-finline-limit
-fstrict-aliasing
-fomit-frame-pointer (actually, this one's always been there)
Back to top
View user's profile Send private message
josephoenix
n00b
n00b


Joined: 21 May 2004
Posts: 9
Location: Happy Linux-Land

PostPosted: Fri Jun 25, 2004 3:24 am    Post subject: Reply with quote

I'm not sure if this is the place to ask this, but I am installing gentoo (again) and I am unsure of what would be the best cflags for this:
Code:

root@1[root]# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 12
model name      : AMD Athlon(tm) 64 Processor 3000+
stepping        : 0
cpu MHz         : 1999.456
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall mmxext lm 3dnowext 3dnow
bogomips        : 3984.58



help would be much appreciated! :)

josephoenix
_________________
Current attempts to learn languages:
PHP (and MYSQL) - 20%
C++ - 30%
BASIC - 100% (We all have to start somewhere)
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Fri Jun 25, 2004 9:58 pm    Post subject: Reply with quote

Ah, you git, I've got one of those on the way... I hope. Ordered it a month ago today. And it still isn't here! :x

Anyway, it depends - what version of GCC are you planning on using? If you're using 3.4, don't combine -O3 and -ftracer, as it causes problems.
_________________
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Back to top
View user's profile Send private message
semiSfear
Guru
Guru


Joined: 08 Jul 2003
Posts: 302
Location: Adelaide, SA

PostPosted: Wed Jun 30, 2004 12:19 pm    Post subject: Reply with quote

Does it matter where in CFLAGS you put the -pipe option? For example I got this in my make.conf file: CFLAGS="-march=athlon-xp -pipe -O3 -fomit-frame-pointer"

Does it matter if it looks like this:

CFLAGS="-march=athlon-xp -pipe -O3 -fomit-frame-pointer"

or if it looks like this:

CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"

?
_________________
DnB is my religion, Jungle is my church.
Back to top
View user's profile Send private message
zaanpenguin
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 203

PostPosted: Wed Jun 30, 2004 12:38 pm    Post subject: Reply with quote

robmoss2k wrote:
Ah, you git, I've got one of those on the way... I hope. Ordered it a month ago today. And it still isn't here! :x

Anyway, it depends - what version of GCC are you planning on using? If you're using 3.4, don't combine -O3 and -ftracer, as it causes problems.


Can you tell me what kind of problems to expect? I've been using GCC 3.4 with -ftracer and -O3 and so far so good... :?
_________________
Staying crunchy even in milk!
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2, 3 ... 28, 29, 30 ... 35, 36, 37  Next
Page 29 of 37

 
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