which use flags for gentoo?

Discussion in 'Linux & BSD' started by Dark Atheist, Apr 18, 2008.

  1. Dark Atheist

    Dark Atheist Moderator Political User Folding Team

    Messages:
    6,376
    Location:
    In The Void
    ok so i am messing about with gentoo, but i have no clue what use flags to use

    (Usually, (the number of processors + 1) is a good value)
    mybox ~ # echo 'MAKEOPTS="-j2"' >> /etc/make.conf

    so for a p4m 1.8 that should be j2 as shown, for a dual core j3 and quad core j5 ?

    cflags and use flags are confusing the hell out of me though, are they really required ?

    edit: just found this - http://gentoo-wiki.com/Safe_Cflags
     
    Last edited: Apr 18, 2008
  2. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    Don't go crazy with your cflags, it will offer very little in the way of performance gains and offer very much in the way of headaches and failed compiles.

    Use flags are the best part of Gentoo, it is what allows you to customize the compilation of each program. Personally I find it way more useful than the BSD's. X will be here shortly to mention how Gentoo sucks and it has way too many custom patches, but I personally love Gentoo.

    If you are using Gentoo for a desktop, link to the desktop profile, e.g.

    ln -s /etc/make.profile /usr/portage/profiles/default-linux/<arch>/2007.1/desktop

    That should give you some good use flag defaults.
     
  3. Dark Atheist

    Dark Atheist Moderator Political User Folding Team

    Messages:
    6,376
    Location:
    In The Void
    if you look at the link in my post above and you look at the cflags below which someone gave me - who is rather up with Gentoo you will see there is little difference per se

    CFLAGS="-O2 -fforce-addr -fomit-frame-pointer -march=x86-64 -mmmx -msse -msse2 -pipe"
    CHOST="x86_64-pc-linux-gnu"
    CXXFLAGS="${CFLAGS}"


    i have stuck with the cflags from the link in my original post.

    so far apart from the way Gentoo likes to be setup and the different commands i find Gentoo and freebsd very similar, although i have only just started messing with Gentoo.

    So that file will give me all the flags i require for gnome/kde/xfce - what about alsa and things like that?
     
  4. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    You can read the make.defaults file in the directory that is linked, it lists the use flags it sets. If you want to only use gnome, I would disable qt3, qt4, kde and artsd in make.conf and if you only want to use kde, disable gnome, evo and eds.

    I should have used 2007.0 instead of 2007.1 btw.

    CFLAGS="-O2 -fforce-addr -fomit-frame-pointer -march=x86-64 -mmmx -msse -msse2 -pipe" would probably cause problems.

    You have a 64-bit P4 from what I can tell. Do not change the CHOST variable. I would use the following:

    CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
    CXXFLAGS="${CFLAGS}"
    You do not have to set -mmmx -msse -msse2 since they are implied by your arch setting. I never set anything other than fomit-frame-pointer and -pipe. Anything over -O2 can cause strange results.
     
  5. Dark Atheist

    Dark Atheist Moderator Political User Folding Team

    Messages:
    6,376
    Location:
    In The Void
    nope AMD64 X2 - so with the make flags its a case of try and see, if something works you did it right if it doesn't you didn't :)

    if i can get it working fine i might put it onto my amd64 x2 and not t he persons who pc i am holding hostage till he pays me for the repairs i did to his pc :p

    so would need the cflags for a p4 m 1.8 and amd64 x2
     
  6. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    For 64-bit X2

    CHOST="x86_64-pc-linux-gnu"
    CFLAGS="-march=athlon64 -O2 -pipe"
    CXXFLAGS="${CFLAGS}"


    For the P4-m

    CHOST="i686-pc-linux-gnu"
    CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    CXXFLAGS="${CFLAGS}"

    You can always adjust your use flags, then run

    emerge --ask --verbose --newuse --update --deep world

    To recompile with your new use flags set.
     
    Dark Atheist likes this.
  7. Dark Atheist

    Dark Atheist Moderator Political User Folding Team

    Messages:
    6,376
    Location:
    In The Void
    sweet - thanks :)
     
  8. Dark Atheist

    Dark Atheist Moderator Political User Folding Team

    Messages:
    6,376
    Location:
    In The Void
    something we overlooked -

    (Usually, (the number of processors + 1) is a good value)
    mybox ~ # echo 'MAKEOPTS="-j2"' >> /etc/make.conf

    so for a p4m 1.8 that should be j2 as shown, for a dual core j3 and quad core j5 ?

    from my original post
     
  9. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    Yep that should work.
     
  10. Dark Atheist

    Dark Atheist Moderator Political User Folding Team

    Messages:
    6,376
    Location:
    In The Void
    thank god for that, thought i might have to recompile everything yet again
     
  11. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    You wouldn't have to recompile, the only thing that affect is how many threads are used during compilation. Usually setting it too high will cause the system to freeze.
     
  12. Dark Atheist

    Dark Atheist Moderator Political User Folding Team

    Messages:
    6,376
    Location:
    In The Void