Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Extreme CFLAGS problems...
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Fri Apr 01, 2005 11:41 am    Post subject: Reply with quote

lamaistres wrote:
Can someone give me the name of an ebuild that breaks when I compile with -ffast-math. I'm just curious.


There should be none left, plenty of ebuilds filter CFLAGS (especially totally nutty ones like -ffast-math) so you dont hurt yourself while running with razors ;-)
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2968

PostPosted: Fri Apr 01, 2005 11:43 am    Post subject: Reply with quote

yogi85 wrote:
Quote:
"-march=pentium3 -O2 -fweb -pipe -fomit-frame-pointer -ftracer -fforce-addr -ftree-vectorize -ftree-vectorizer-verbose=1 "


8O can anyone explain to me wat is this vectorizer thingy doing there....i thought it something got to do with graphics thing...if it is...can i compile it with gimp??

Please, don't play with fire.

Dangerous CFLAGS, such as the whole list you quoted, are the Gentoo equivalent of matches and fire. Don't even think of them.
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Fri Apr 01, 2005 12:19 pm    Post subject: Reply with quote

Some of it is sane. -fweb is in the orange zone (should be OK but not guaranteed), but it's almost like the author snorted Columbian sugar about halfway down the list.
Is -ftree-vectorize even a CFLAG? Doesn't show up in the gcc manual...
Back to top
View user's profile Send private message
allanw
Arch/Herd Tester
Arch/Herd Tester


Joined: 02 Mar 2005
Posts: 60

PostPosted: Fri Apr 01, 2005 3:55 pm    Post subject: Reply with quote

It's one of those new gcc4 optimizations.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2968

PostPosted: Fri Apr 01, 2005 4:04 pm    Post subject: Reply with quote

allanw wrote:
It's one of those new gcc4 optimizations.

Read that as
Quote:
It's one of those new shiny nuclear warheads that will immediately toast your Gentoo system and reduce it to a smoking pile of ash.
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Fri Apr 01, 2005 7:52 pm    Post subject: Reply with quote

kimchi_sg wrote:
allanw wrote:
It's one of those new gcc4 optimizations.

Read that as
Quote:
It's one of those new shiny nuclear warheads that will immediately toast your Gentoo system and reduce it to a smoking pile of ash.


I thought even ciaranm once said that vectorizing is silly, but shouldn't break anything. Unlike fuzzy logic options like -ffast-math ;-)
Back to top
View user's profile Send private message
fca
Guru
Guru


Joined: 22 Feb 2003
Posts: 346
Location: Netherlands

PostPosted: Fri Apr 01, 2005 8:20 pm    Post subject: Reply with quote

lamaistres wrote:
Can someone give me the name of an ebuild that breaks when I compile with -ffast-math. I'm just curious.

Packages that break with -ffast-math forced are roughly 2 categories:
System libraries
Things that implement math functions in a funky way (gmp comes to mind).

Other things should not be broken by -ffast-math. I've tested it, and all audio/video encoding programs that I've tested function correctly with -ffast-math. In fact, a lot of them recommend setting it (or default to it), because of the thing it does: speed up floating-point operations at the cost of correctness in corner cases. System libraries and funky math libraries cannot stand it, because of the exact same thing. However, it doesn't mean -ffast-math shouldn't be used at all. In fact, I've used it on code that I used to calculate things for my thesis. Why? Because it sped things up, and it didn't break the code. Results were the same, just a measly 10% faster, which matters a lot if you're running the thing for about a week.

I think this thread is going a bit too far in bunking crazy CFLAGS. They have their uses sometimes, GCC authors do not implement them because they feel a need for broken flags or something. It's just that many of them have uses that a normal Gentoo user doesn't come close to, but sometimes they can be useful. Some flags considered stable by Gentoo developers are considered broken or not ready by GCC developers (-fstack-protector, -fvisibility-inlines-hidden), and vice versa.

Calling new gcc4 optimizations nuclear warheads or something isn't going to help them become stable. If you dare, test them, if you don't dare, wait for others to test them.
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Fri Apr 01, 2005 8:21 pm    Post subject: Reply with quote

fca wrote:
lamaistres wrote:
Can someone give me the name of an ebuild that breaks when I compile with -ffast-math. I'm just curious.

Packages that break with -ffast-math forced are roughly 2 categories:
System libraries
Things that implement math functions in a funky way (gmp comes to mind).

Other things should not be broken by -ffast-math. I've tested it, and all audio/video encoding programs that I've tested function correctly with -ffast-math. In fact, a lot of them recommend setting it (or default to it), because of the thing it does: speed up floating-point operations at the cost of correctness in corner cases. System libraries and funky math libraries cannot stand it, because of the exact same thing. However, it doesn't mean -ffast-math shouldn't be used at all. In fact, I've used it on code that I used to calculate things for my thesis. Why? Because it sped things up, and it didn't break the code. Results were the same, just a measly 10% faster, which matters a lot if you're running the thing for about a week.

I think this thread is going a bit too far in bunking crazy CFLAGS. They have their uses sometimes, GCC authors do not implement them because they feel a need for broken flags or something. It's just that many of them have uses that a normal Gentoo user doesn't come close to, but sometimes they can be useful. Some flags considered stable by Gentoo developers are considered broken or not ready by GCC developers (-fstack-protector, -fvisibility-inlines-hidden), and vice versa.

Calling new gcc4 optimizations nuclear warheads or something isn't going to help them become stable. If you dare, test them, if you don't dare, wait for others to test them.


Please give me the source of said thesis code.
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Fri Apr 01, 2005 9:00 pm    Post subject: Reply with quote

fca wrote:
Packages that break with -ffast-math forced are roughly 2 categories:
System libraries
Things that implement math functions in a funky way (gmp comes to mind).

Other things should not be broken by -ffast-math.

Complete bollocks. Anything that uses floating point that has not explicitly been designed to work with -ffast-math will be broken.
Back to top
View user's profile Send private message
slikdigit
n00b
n00b


Joined: 30 Aug 2002
Posts: 73
Location: US

PostPosted: Fri Apr 01, 2005 9:03 pm    Post subject: Reply with quote

I remember somewhere someone optimised blender with fastmath (not in gentoo, and not me) and got ugly render artifacts.
_________________
I like tapes.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2968

PostPosted: Sat Apr 02, 2005 12:44 am    Post subject: Reply with quote

slikdigit wrote:
I remember somewhere someone optimised blender with fastmath (not in gentoo, and not me) and got ugly render artifacts.

If it breaks, you get to keep the pieces. :lol:
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Sat Apr 02, 2005 10:06 am    Post subject: Reply with quote

Not surprising that they get ugly render artifacts, after all, their floating point is all broked.

Btw ciaranm is it possible to get code to play nicely with -ffast-math and still have it work with non-ffast-math?
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Sat Apr 02, 2005 4:46 pm    Post subject: Reply with quote

racoontje wrote:
Not surprising that they get ugly render artifacts, after all, their floating point is all broked.

Btw ciaranm is it possible to get code to play nicely with -ffast-math and still have it work with non-ffast-math?

Oh, sure. 'All' you have to do to get your code to play nice with -ffast-math is to make sure it will never generate any floating point exceptions, that it doesn't rely too heavily on precision and that the occasional utterly screwy result makes no difference. Relying upon -ffast-math's broken behaviour would be utterly weird -- taking it into account and allowing for it, on the other hand, is useful sometimes.
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Sat Apr 02, 2005 9:34 pm    Post subject: Reply with quote

Can someone pinpoint a concreate package that is known to break with -ffast-math and does not filter the flag already ?
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Sat Apr 02, 2005 9:45 pm    Post subject: Reply with quote

IvanYosifov wrote:
Can someone pinpoint a concreate package that is known to break with -ffast-math and does not filter the flag already ?

dev-lang/perl
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Sun Apr 03, 2005 9:24 am    Post subject: Reply with quote

Ok... I emerged perl with -ffast-math. It compiled. How do I make it crash and burn ?
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Sun Apr 03, 2005 9:28 am    Post subject: Reply with quote

IvanYosifov wrote:
Ok... I emerged perl with -ffast-math. It compiled. How do I make it crash and burn ?

Do some floating point code that raises time-critical exceptions.
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Sun Apr 03, 2005 9:43 am    Post subject: Reply with quote

Quote:
Do some floating point code that raises time-critical exceptions.

I could do that in C, compile with -ffast-math, and conclude that gcc is broken.

The wording of my original question was wrong, sorry. I am trying to understand the real negative effects
of -ffast-math. So the question I wanted to ask is: are there any ebuilds that will be broken out of the box? Interpreters I can brake with code writen by me do not count. If some perl package, however, contains such code - it does count.
Back to top
View user's profile Send private message
whitesouls
Guru
Guru


Joined: 19 Nov 2004
Posts: 358
Location: In Front of My Laptop

PostPosted: Sun Apr 03, 2005 11:13 am    Post subject: Reply with quote

no wonder last time my system broke...i used the -fweb -ffast-math together...cant get the system at all...kept on receving errors...

Code:
CFLAGS="-O3 -march=pentium3 -pipe -fomit-frame-pointer -minline-all-stringops -foptim
ize-sibling-calls -fcaller-saves -falign-functions=64 -finline-functions -funit-at-a-
time"


is this cflags ok??i'm using now and kimchi..i would like to see ur cflags if possible..thanks..:D
_________________
whitesouls

Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2968

PostPosted: Sun Apr 03, 2005 11:58 am    Post subject: Reply with quote

yogi85 wrote:
Code:
CFLAGS="-O3 -march=pentium3 -pipe -fomit-frame-pointer -minline-all-stringops -foptimize-sibling-calls -fcaller-saves -falign-functions=64 -finline-functions -funit-at-a-
time"

is this cflags ok??

Seriously, I think everything in there should be taken out, except for "-O3 -march=pentium3 -pipe -fomit-frame-pointer".

I've used Gentoo long enough to wean myself off most of the CFLAGS hype already.
yogi85 wrote:
i'm using now and kimchi..i would like to see ur cflags if possible..thanks..:D

Here's mine. I use only the ones "recommended" in the Stage 1-on-3 tutorial:
Code:
shrek@maximus ~ $ grep ^CFLAGS /etc/make.conf
CFLAGS="-march=pentium4 -mtune=pentium4 -O3 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -fforce-addr -ftracer"
shrek@maximus ~ $ grep ^CXXFLAGS /etc/make.conf
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
Back to top
View user's profile Send private message
Helena
Veteran
Veteran


Joined: 02 Apr 2003
Posts: 1114
Location: Den Dolder, The Netherlands

PostPosted: Sun Apr 03, 2005 12:34 pm    Post subject: Reply with quote

kimchi_sg wrote:
Here's mine. I use only the ones "recommended" in the Stage 1-on-3 tutorial:
Code:
shrek@maximus ~ $ grep ^CFLAGS /etc/make.conf
CFLAGS="-march=pentium4 -mtune=pentium4 -O3 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -fforce-addr -ftracer"
shrek@maximus ~ $ grep ^CXXFLAGS /etc/make.conf
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
After reading almost this entire thread I was already wondering why a bug that I filed with the same CFLAGS setting was even being considered :? . I am very happy with this 1-on-3 system, it feels much faster than the traditional set-up I have running in parallel (it's a multi-boot system) and consider myself a sane Gentoo user. There's only 1 library that did not compile and one flag had to be filtered out. True, I needed a bug report to find that out.

So I guess I'll stay on this route and eventually abandon the other set-up...:)
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2968

PostPosted: Sun Apr 03, 2005 12:36 pm    Post subject: Reply with quote

Helena wrote:
After reading almost this entire thread I was already wondering why a bug that I filed with the same CFLAGS setting was even being considered ... There's only 1 library that did not compile and one flag had to be filtered out...

Please tell us what that library or package was. :)
Back to top
View user's profile Send private message
whitesouls
Guru
Guru


Joined: 19 Nov 2004
Posts: 358
Location: In Front of My Laptop

PostPosted: Sun Apr 03, 2005 1:03 pm    Post subject: Reply with quote

:D ...kimchi..i'm using this cflags but there's no poblem except for compiling firefox and mozilla with ldflags

Code:
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s -z now"


and for me it looks stable..the method stage 1 on 3...i was doing tht without realising there's a guide in the forums...i realised this when i went thru the documentation and tips....may i know why did you ask me to take out everything...

Code:
-momit-leaf-frame-pointer -fforce-addr -ftracer
1. Please tell me wat this line does and
Code:
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
2. Is this line is applicable in gcc 3.4.3 and i'm puzzled what this line actually does.....
3.Kimchi, are you tuning your system to be hard and stable or more towards performance?

coz i guess there should be a certain flags where it ensures both stability as well as performance there rather than leaving it as normal cflags

Code:
"-march=pentium4 -mtune=pentium4 -O3 -pipe -fomit-frame-pointer"

_________________
whitesouls

Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Back to top
View user's profile Send private message
Helena
Veteran
Veteran


Joined: 02 Apr 2003
Posts: 1114
Location: Den Dolder, The Netherlands

PostPosted: Sun Apr 03, 2005 1:57 pm    Post subject: Reply with quote

kimchi_sg wrote:
Helena wrote:
After reading almost this entire thread I was already wondering why a bug that I filed with the same CFLAGS setting was even being considered ... There's only 1 library that did not compile and one flag had to be filtered out...

Please tell us what that library or package was. :)
Sorry didn't think it was important at this point.:o

It was libsdl-1.2.8-r1 and the flag was -fforce-addr. See https://bugs.gentoo.org/show_bug.cgi?id=87077


/EDIT: fixed the bug URL.
Back to top
View user's profile Send private message
whitesouls
Guru
Guru


Joined: 19 Nov 2004
Posts: 358
Location: In Front of My Laptop

PostPosted: Mon Apr 04, 2005 4:08 am    Post subject: Reply with quote

So, kimchi...or anybody...please answer my question coz i'm kind of blur of this cflags rite now....
_________________
whitesouls

Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Page 9 of 10

 
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