View previous topic :: View next topic |
Author |
Message |
racoontje Veteran
Joined: 19 Jul 2004 Posts: 1290
|
Posted: Fri Apr 01, 2005 11:41 am Post subject: |
|
|
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 |
|
|
kimchi_sg Advocate
Joined: 26 Nov 2004 Posts: 2968
|
Posted: Fri Apr 01, 2005 11:43 am Post subject: |
|
|
yogi85 wrote: | Quote: | "-march=pentium3 -O2 -fweb -pipe -fomit-frame-pointer -ftracer -fforce-addr -ftree-vectorize -ftree-vectorizer-verbose=1 " |
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 |
|
|
racoontje Veteran
Joined: 19 Jul 2004 Posts: 1290
|
Posted: Fri Apr 01, 2005 12:19 pm Post subject: |
|
|
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 |
|
|
allanw Arch/Herd Tester
Joined: 02 Mar 2005 Posts: 60
|
Posted: Fri Apr 01, 2005 3:55 pm Post subject: |
|
|
It's one of those new gcc4 optimizations. |
|
Back to top |
|
|
kimchi_sg Advocate
Joined: 26 Nov 2004 Posts: 2968
|
Posted: Fri Apr 01, 2005 4:04 pm Post subject: |
|
|
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 |
|
|
racoontje Veteran
Joined: 19 Jul 2004 Posts: 1290
|
Posted: Fri Apr 01, 2005 7:52 pm Post subject: |
|
|
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 |
|
|
fca Guru
Joined: 22 Feb 2003 Posts: 346 Location: Netherlands
|
Posted: Fri Apr 01, 2005 8:20 pm Post subject: |
|
|
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 |
|
|
racoontje Veteran
Joined: 19 Jul 2004 Posts: 1290
|
Posted: Fri Apr 01, 2005 8:21 pm Post subject: |
|
|
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 |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Fri Apr 01, 2005 9:00 pm Post subject: |
|
|
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 |
|
|
slikdigit n00b
Joined: 30 Aug 2002 Posts: 73 Location: US
|
Posted: Fri Apr 01, 2005 9:03 pm Post subject: |
|
|
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 |
|
|
kimchi_sg Advocate
Joined: 26 Nov 2004 Posts: 2968
|
Posted: Sat Apr 02, 2005 12:44 am Post subject: |
|
|
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. |
|
Back to top |
|
|
racoontje Veteran
Joined: 19 Jul 2004 Posts: 1290
|
Posted: Sat Apr 02, 2005 10:06 am Post subject: |
|
|
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 |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Sat Apr 02, 2005 4:46 pm Post subject: |
|
|
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 |
|
|
IvanYosifov l33t
Joined: 15 Oct 2004 Posts: 778 Location: Bulgaria
|
Posted: Sat Apr 02, 2005 9:34 pm Post subject: |
|
|
Can someone pinpoint a concreate package that is known to break with -ffast-math and does not filter the flag already ? |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Sat Apr 02, 2005 9:45 pm Post subject: |
|
|
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 |
|
|
IvanYosifov l33t
Joined: 15 Oct 2004 Posts: 778 Location: Bulgaria
|
Posted: Sun Apr 03, 2005 9:24 am Post subject: |
|
|
Ok... I emerged perl with -ffast-math. It compiled. How do I make it crash and burn ? |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Sun Apr 03, 2005 9:28 am Post subject: |
|
|
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 |
|
|
IvanYosifov l33t
Joined: 15 Oct 2004 Posts: 778 Location: Bulgaria
|
Posted: Sun Apr 03, 2005 9:43 am Post subject: |
|
|
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 |
|
|
whitesouls Guru
Joined: 19 Nov 2004 Posts: 358 Location: In Front of My Laptop
|
Posted: Sun Apr 03, 2005 11:13 am Post subject: |
|
|
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.. _________________ whitesouls
Please insert the [SOLVED] tag if your problem is solved in your respective thread. |
|
Back to top |
|
|
kimchi_sg Advocate
Joined: 26 Nov 2004 Posts: 2968
|
Posted: Sun Apr 03, 2005 11:58 am Post subject: |
|
|
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.. |
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 |
|
|
Helena Veteran
Joined: 02 Apr 2003 Posts: 1114 Location: Den Dolder, The Netherlands
|
Posted: Sun Apr 03, 2005 12:34 pm Post subject: |
|
|
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 |
|
|
kimchi_sg Advocate
Joined: 26 Nov 2004 Posts: 2968
|
Posted: Sun Apr 03, 2005 12:36 pm Post subject: |
|
|
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 |
|
|
whitesouls Guru
Joined: 19 Nov 2004 Posts: 358 Location: In Front of My Laptop
|
Posted: Sun Apr 03, 2005 1:03 pm Post subject: |
|
|
...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 |
|
|
Helena Veteran
Joined: 02 Apr 2003 Posts: 1114 Location: Den Dolder, The Netherlands
|
Posted: Sun Apr 03, 2005 1:57 pm Post subject: |
|
|
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.
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 |
|
|
whitesouls Guru
Joined: 19 Nov 2004 Posts: 358 Location: In Front of My Laptop
|
Posted: Mon Apr 04, 2005 4:08 am Post subject: |
|
|
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 |
|
|
|