Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
AMD64 2005.0 and USE/MAKE flags.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
Lin-Darian
Tux's lil' helper
Tux's lil' helper


Joined: 24 Mar 2005
Posts: 84

PostPosted: Wed Apr 06, 2005 3:48 am    Post subject: AMD64 2005.0 and USE/MAKE flags. Reply with quote

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
View user's profile Send private message
Karsten from Berlin
Guru
Guru


Joined: 28 Feb 2004
Posts: 446
Location: Berlin/Germany

PostPosted: Wed Apr 06, 2005 7:58 am    Post subject: Reply with quote

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
View user's profile Send private message
erikdenv
n00b
n00b


Joined: 24 May 2004
Posts: 33
Location: The Netherlands

PostPosted: Wed Apr 06, 2005 8:45 am    Post subject: Reply with quote

You can also use --newuse to compile only the programs that are affected by the new use-flags.
Back to top
View user's profile Send private message
Lin-Darian
Tux's lil' helper
Tux's lil' helper


Joined: 24 Mar 2005
Posts: 84

PostPosted: Wed Apr 06, 2005 5:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Karsten from Berlin
Guru
Guru


Joined: 28 Feb 2004
Posts: 446
Location: Berlin/Germany

PostPosted: Thu Apr 07, 2005 7:06 am    Post subject: Reply with quote

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 :oops:

[/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
View user's profile Send private message
Strowi
l33t
l33t


Joined: 19 Aug 2003
Posts: 656
Location: Bonn

PostPosted: Thu Apr 07, 2005 9:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Karsten from Berlin
Guru
Guru


Joined: 28 Feb 2004
Posts: 446
Location: Berlin/Germany

PostPosted: Thu Apr 07, 2005 10:23 am    Post subject: Reply with quote

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
View user's profile Send private message
pwe
Guru
Guru


Joined: 12 Mar 2005
Posts: 445
Location: Polska aka Poland

PostPosted: Thu Apr 07, 2005 11:58 am    Post subject: Reply with quote

@Karsten from Berlin -> CFLAGS & CXXFLAGS set the same ? or i must modifie CXXFLAGS ?

thanks!
_________________
there is no empty MHz :)
Back to top
View user's profile Send private message
Karsten from Berlin
Guru
Guru


Joined: 28 Feb 2004
Posts: 446
Location: Berlin/Germany

PostPosted: Thu Apr 07, 2005 12:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
pwe
Guru
Guru


Joined: 12 Mar 2005
Posts: 445
Location: Polska aka Poland

PostPosted: Thu Apr 07, 2005 1:25 pm    Post subject: Reply with quote

thanks, i'd try this :)
_________________
there is no empty MHz :)
Back to top
View user's profile Send private message
marcion
Apprentice
Apprentice


Joined: 14 Mar 2005
Posts: 158
Location: England

PostPosted: Thu Apr 07, 2005 2:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
druggo
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 289
Location: Hangzhou, China

PostPosted: Tue Aug 02, 2005 9:36 am    Post subject: Reply with quote

nice£¡
I will try it on my box.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
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