View previous topic :: View next topic |
Author |
Message |
Lin-Darian Tux's lil' helper
Joined: 24 Mar 2005 Posts: 84
|
Posted: Wed Apr 06, 2005 3:48 am Post subject: AMD64 2005.0 and USE/MAKE flags. |
|
|
My system:
AMD64 3200+ / ASUS AV8 Deluxe MB
4Gb Corsair Duel DDR400
2 160gb HDDs on a Promise SATA Controller
2 160gb HDDs on a VIA SATA Controller
Creative Audigy 2 ZS Platnium
5.1 Altec Lansing Speaker system
nVidia 6800 256mb 8x AGP graphic card
/etc/make.conf: Quote: | CFLAGS="-O2 -march=k8"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" |
I want to reemerge my whole world/system after modifying my make.conf and USE flags in an attempt to boost preformence and to fix minor bugs (for example I emerged KDE without adding ARTS to the USE flags and so my KDE install has no sound tho yes the programms I run like XMM and XINE _DO_ output sound. I have read over the USE flags and CHOST flags and honestly all that did was confuse me. I'm the worst type of a user, hehe. A semi-programmer. I write some programs and simple things. In other words, I know just enough to be dangerous to my computer's health :P
So my question is, what advice would the community give me for optimizing my gentoo system? |
|
Back to top |
|
|
Karsten from Berlin Guru
Joined: 28 Feb 2004 Posts: 446 Location: Berlin/Germany
|
Posted: Wed Apr 06, 2005 7:58 am Post subject: |
|
|
Here's the answer:
How about a 'man emerge'?
Take a special look at the option '--emptytree (-e)'... _________________ Heaven: The police are British, the chefs Italian, the mechanics German, the lovers French and it's organized by the Swiss.
Hell: The police are German, the chefs British, the mechanics French, the lovers Swiss and it's organized by the Italians. |
|
Back to top |
|
|
erikdenv n00b
Joined: 24 May 2004 Posts: 33 Location: The Netherlands
|
Posted: Wed Apr 06, 2005 8:45 am Post subject: |
|
|
You can also use --newuse to compile only the programs that are affected by the new use-flags. |
|
Back to top |
|
|
Lin-Darian Tux's lil' helper
Joined: 24 Mar 2005 Posts: 84
|
Posted: Wed Apr 06, 2005 5:58 pm Post subject: |
|
|
That's not really an answer, Karsten. SInce I know about the emerge --newuse and --emptytree. The question was what USE and CHOST flags best optimizes the system |
|
Back to top |
|
|
Karsten from Berlin Guru
Joined: 28 Feb 2004 Posts: 446 Location: Berlin/Germany
|
Posted: Thu Apr 07, 2005 7:06 am Post subject: |
|
|
Oh, ok, sorry for that. Wasn't clear to me.
Well, your CHOST is fix, because this describes your plattform. And if you want to compile a 64bit Gentoo, that's the right setting. Never change this afterwards!
CFLAGS: Unfortunately I'm at work now, but I'll try to give you my CFLAGS from my 64bit at home out of mind:
-march=amd64 - like the manpages says, it's the same as k8, so you probably can leave this; -mcpu=... is not needed, because this is included in specifying -march=...
[EDIT]
Ahhh, it's -march=athlon64, NOT -march=amd64
[/EDIT]
-O3 - I always took it for different systems and never had problems (company & home)
-ftracer - enables a better optimization for functions
-funit-at-a-time - enables better optimization by taking the whole compilation unit into account, not only the actual function
-fforce-addr - copies constant adddress-variables into registers before doing calculations with them
-fpeel-loops - removes loops with a small and constant number of iterations
-funswitch-loops - Unswitching: Taking for example a 'if (a > b)' out of a loop where it's in (a and b are constant !!!), and putting the loop in every decision-way. So the decision is not made 1000x, but only once
Want you don't need, or what is dangerous:
-fomit-frame-pointer - as far as I understood an AMD64 has not the frame-pointer as normal x86-systems have, so this option does nothing
-ffast-math - I would not use that. The manpages warn about using this. Your processor has enough power to calculate a lot of things very fast without that
-funswitch-all-loops - As a C developer I definitely say, that this will lead into problems, because it will unroll loops that don't have a constant number of iteration.
A tip what I also use:
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--strip-all"
-Wl,O1 - Optimize the linking
-Wl,--enable-new-dtags - use better/newer way of linking
-Wl,--sort-common - sort symbols in optimized order for faster calling
-Wl,--strip-all - strips all debugging and unneeded symbols from the binary
So, I hope that's what you wanted to know.
Regards _________________ Heaven: The police are British, the chefs Italian, the mechanics German, the lovers French and it's organized by the Swiss.
Hell: The police are German, the chefs British, the mechanics French, the lovers Swiss and it's organized by the Italians.
Last edited by Karsten from Berlin on Thu Apr 07, 2005 10:24 am; edited 1 time in total |
|
Back to top |
|
|
Strowi l33t
Joined: 19 Aug 2003 Posts: 656 Location: Bonn
|
Posted: Thu Apr 07, 2005 9:30 am Post subject: |
|
|
hi,
just a quick question because i got confused: is it -march=amd64 or -march=k8 or both possible (-mtune also?)?
As for the rest my cflags/ldflags look pretty much the same, didn't know that -fomit-frame-pointer was useless, thx.
The USE-Flags you have to choose by yourself. A good start could be to "USE="-*" emerge -epv system" have a look at the used flags and modify them to your needs. Remember: USE-Flags are only responsible to make the compiler aware of support wanted for a special application.
This heavily depends on what you want to do with your system. _________________ --
Linux & such ...
http://blog.hasnoname.de |
|
Back to top |
|
|
Karsten from Berlin Guru
Joined: 28 Feb 2004 Posts: 446 Location: Berlin/Germany
|
Posted: Thu Apr 07, 2005 10:23 am Post subject: |
|
|
man gcc:
-mtune=cpu-type
Tune to cpu-type everything applicable about the generated code, except for the ABI and the set of available instructions. The choices for cpu-type are:
[...]
k8, opteron, athlon64, athlon-fx
AMD K8 core based CPUs with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
[...]
So I wrote an error above: It's -march=athlon64, not -march=amd64. Sorry for that.
man gcc:
-mcpu=cpu-type
A deprecated synonym for -mtune.
-march=cpu-type
Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-
type. _________________ Heaven: The police are British, the chefs Italian, the mechanics German, the lovers French and it's organized by the Swiss.
Hell: The police are German, the chefs British, the mechanics French, the lovers Swiss and it's organized by the Italians. |
|
Back to top |
|
|
pwe Guru
Joined: 12 Mar 2005 Posts: 445 Location: Polska aka Poland
|
Posted: Thu Apr 07, 2005 11:58 am Post subject: |
|
|
@Karsten from Berlin -> CFLAGS & CXXFLAGS set the same ? or i must modifie CXXFLAGS ?
thanks! _________________ there is no empty MHz |
|
Back to top |
|
|
Karsten from Berlin Guru
Joined: 28 Feb 2004 Posts: 446 Location: Berlin/Germany
|
Posted: Thu Apr 07, 2005 12:20 pm Post subject: |
|
|
I have them the same, that means
CXXFLAGS="${CFLAGS}"
But of course you can specify completely different flags for C++-compiling or add some special C++-switches. Adding would look like this:
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden" _________________ Heaven: The police are British, the chefs Italian, the mechanics German, the lovers French and it's organized by the Swiss.
Hell: The police are German, the chefs British, the mechanics French, the lovers Swiss and it's organized by the Italians. |
|
Back to top |
|
|
pwe Guru
Joined: 12 Mar 2005 Posts: 445 Location: Polska aka Poland
|
Posted: Thu Apr 07, 2005 1:25 pm Post subject: |
|
|
thanks, i'd try this _________________ there is no empty MHz |
|
Back to top |
|
|
marcion Apprentice
Joined: 14 Mar 2005 Posts: 158 Location: England
|
Posted: Thu Apr 07, 2005 2:08 pm Post subject: |
|
|
Lin-Darian wrote: | That's not really an answer, Karsten. SInce I know about the emerge --newuse and --emptytree. The question was what USE and CHOST flags best optimizes the system |
Well you need to use 03 for the most optimisation, if that is the optimal choice for you is another matter... |
|
Back to top |
|
|
druggo Apprentice
Joined: 24 Sep 2003 Posts: 289 Location: Hangzhou, China
|
Posted: Tue Aug 02, 2005 9:36 am Post subject: |
|
|
nice£¡
I will try it on my box. |
|
Back to top |
|
|
|
|
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
|
|