Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE flags for a minimal Openbox System
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Sun Apr 01, 2012 5:21 pm    Post subject: USE flags for a minimal Openbox System Reply with quote

Could someone give me some advice about USE flags appropriate for a really minimal OpenBox system? I don't care about gtk or kde. Not a Gnome/Xfce/Kde fan. My system will be used mainly for java/web development, so I definitely need Eclipse and sun JDK. Any ideas?

thanks!
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 440
Location: Kraków, PL

PostPosted: Sun Apr 01, 2012 5:28 pm    Post subject: Reply with quote

Try these:
Code:

USE="-acl -berkdb -consolekit cups -dbus -gdbm -gnome -gnutls -gstreamer -iconv -java -kde -ldap -libnotify ncurses nls -oss pam -policykit python -qt3 -qt3support -qt4 -perl -samba -sdl smp ssl threads -tk -webkit zlib xmp -zeroconf"

I have exactly this set on a powerful workstation which I use mainly for scientific research - so no fancy wobbly wondows, just pure work. I use awesome WM, but Openbox shouldn't need anything more. You may want to change "-java" to "java", "cups" to "-cups" if you do not have printer, and according to your CPU you may want to add all or just some of these:
Code:
3dnow 3dnowext mmx mmxext sse sse2


This is for global USE flags, rest is fine-tuned in /etc/portage/package.use
_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Sun Apr 01, 2012 5:35 pm    Post subject: Reply with quote

gorkypl wrote:
Try these:
Code:

USE="-acl -berkdb -consolekit cups -dbus -gdbm -gnome -gnutls -gstreamer -iconv -java -kde -ldap -libnotify ncurses nls -oss pam -policykit python -qt3 -qt3support -qt4 -perl -samba -sdl smp ssl threads -tk -webkit zlib xmp -zeroconf"

I have exactly this set on a powerful workstation which I use mainly for scientific research - so no fancy wobbly wondows, just pure work. I use awesome WM, but Openbox shouldn't need anything more. You may want to change "-java" to "java", "cups" to "-cups" if you do not have printer, and according to your CPU you may want to add all or just some of these:
Code:
3dnow 3dnowext mmx mmxext sse sse2


This is for global USE flags, rest is fine-tuned in /etc/portage/package.use


Thanks. I don't use 3D at all, apart the xclockmore's 3D animations.
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 440
Location: Kraków, PL

PostPosted: Sun Apr 01, 2012 5:40 pm    Post subject: Reply with quote

3dnow and 3dnowext have nothing in common with 3D acceleration, they are processor-specific USE flags like mmx or sse. They are AMD specific AFAIK.

To see what your processor supports you may do
Code:
cat /proc/cpuinfo | grep flags

Keep in mind that not all CPU flags can be translated into valid USE flags (rather the opposite). I have specified those that I use.
_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Sun Apr 01, 2012 7:12 pm    Post subject: Reply with quote

gorkypl wrote:
3dnow and 3dnowext have nothing in common with 3D acceleration, they are processor-specific USE flags like mmx or sse. They are AMD specific AFAIK.

To see what your processor supports you may do
Code:
cat /proc/cpuinfo | grep flags

Keep in mind that not all CPU flags can be translated into valid USE flags (rather the opposite). I have specified those that I use.

Just found this wiki. Should I just cp the entries?

http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD#C-30.2C_C-50.2C_C-60.2C_E-350.2C_E-450_series

Code:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe -mno-3dnow -mcx16 -mpopcnt -mssse3 -msse4a -mmmx"
CXXFLAGS="${CFLAGS}"
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 440
Location: Kraków, PL

PostPosted: Sun Apr 01, 2012 7:16 pm    Post subject: Reply with quote

gentian wrote:

Just found this wiki. Should I just cp the entries?
Code:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe -mno-3dnow -mcx16 -mpopcnt -mssse3 -msse4a -mmmx"
CXXFLAGS="${CFLAGS}"

No, use -march=native instead, which will auto-detect and fine-tune your processor.
Code:

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

_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Sun Apr 01, 2012 7:18 pm    Post subject: Reply with quote

gorkypl wrote:
gentian wrote:

Just found this wiki. Should I just cp the entries?
Code:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe -mno-3dnow -mcx16 -mpopcnt -mssse3 -msse4a -mmmx"
CXXFLAGS="${CFLAGS}"

No, use -march=native instead, which will auto-detect your processor.
Code:

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


argh.. I used the -march=k8 during installation since this is an amd cpu.. Did I mess it up really bad?
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 440
Location: Kraków, PL

PostPosted: Sun Apr 01, 2012 7:53 pm    Post subject: Reply with quote

gentian wrote:

argh.. I used the -march=k8 during installation since this is an amd cpu.. Did I mess it up really bad?

No, not at all :)
Jut change it now and either rebuild world (emerge -e world) which will take long time, or leave it alone - only the newly built packages will gain optimization, but after half a year you will probably have all your system rebuilt ;)
_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Mon Apr 02, 2012 6:46 am    Post subject: Reply with quote

gorkypl wrote:
gentian wrote:

argh.. I used the -march=k8 during installation since this is an amd cpu.. Did I mess it up really bad?

No, not at all :)
Jut change it now and either rebuild world (emerge -e world) which will take long time, or leave it alone - only the newly built packages will gain optimization, but after half a year you will probably have all your system rebuilt ;)

Thanks. Just wondering. Can I use "-march=native" at the beginning of any installation for my boxes? Or do I need to have a working system first? Also, will "-march=native" get all the right flags for me and put them into my make.conf automatically?
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9464
Location: Córdoba (Spain)

PostPosted: Mon Apr 02, 2012 8:28 am    Post subject: Reply with quote

You can use the flag from the beginning.

"-march=native" won't change anything in your make.conf or elsewhere. It'll just instruct gcc to generate binaries that are 100% compatible with your cpu to -hopefully- use 100% of its capabilities. Those binaries won't run in any other machine unless it has a similar enough cpu.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
blackst0ne
n00b
n00b


Joined: 14 Jul 2007
Posts: 6
Location: YS, Russia

PostPosted: Mon Apr 02, 2012 8:41 am    Post subject: Reply with quote

According http://www.gentoo.org/doc/en/distcc.xml it's not possible to use -march=native and distcc together.

Is it right?
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Mon Apr 02, 2012 8:49 am    Post subject: Reply with quote

i92guboj wrote:
You can use the flag from the beginning.

"-march=native" won't change anything in your make.conf or elsewhere. It'll just instruct gcc to generate binaries that are 100% compatible with your cpu to -hopefully- use 100% of its capabilities. Those binaries won't run in any other machine unless it has a similar enough cpu.

That "hopefully" statement sounds tad intimidating to me, as I want to have a fast system.. What would the difference be if I use the Cflags mentioned on the cflags reccomendations page for my cpu vs the -march=native?

thx!
Back to top
View user's profile Send private message
yngwin
Developer
Developer


Joined: 19 Dec 2002
Posts: 4389
Location: Suzhou, China

PostPosted: Mon Apr 02, 2012 10:13 am    Post subject: Reply with quote

blackst0ne wrote:
According http://www.gentoo.org/doc/en/distcc.xml it's not possible to use -march=native and distcc together.

Is it right?

That's right. Which is why I recommend to avoid march=native and set cpu specific flags instead.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 440
Location: Kraków, PL

PostPosted: Mon Apr 02, 2012 10:35 am    Post subject: Reply with quote

gentian wrote:

That "hopefully" statement sounds tad intimidating to me, as I want to have a fast system.. What would the difference be if I use the Cflags mentioned on the cflags reccomendations page for my cpu vs the -march=native?

That recommended set of flags my or may not be complete. Using -march=native with a recent gcc version you can be almot sure that ALL gcc flags specific to your CPU are set.
The problem is that such compiled programs may not run on a different CPU (because they were fine-tuned for your CPU, which may or may not be compatible with another one) - thus the problem with distcc.

Also remember that -march=native is a GCC setting and it won't affect USE flags, which you still have to tune manually.

A final note - I remember tests showing that the speed benefit between -march=native and a generic branch like i686 may be very little, and it depends on specific application. So while Gentoo gives you the possibility to use optimized GCC flags, it will not magically turn your HTPC into a SGI workstation.
_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Mon Apr 02, 2012 11:44 am    Post subject: Reply with quote

gorkypl wrote:
gentian wrote:

That "hopefully" statement sounds tad intimidating to me, as I want to have a fast system.. What would the difference be if I use the Cflags mentioned on the cflags reccomendations page for my cpu vs the -march=native?

That recommended set of flags my or may not be complete. Using -march=native with a recent gcc version you can be almot sure that ALL gcc flags specific to your CPU are set.
The problem is that such compiled programs may not run on a different CPU (because they were fine-tuned for your CPU, which may or may not be compatible with another one) - thus the problem with distcc.

Also remember that -march=native is a GCC setting and it won't affect USE flags, which you still have to tune manually.

A final note - I remember tests showing that the speed benefit between -march=native and a generic branch like i686 may be very little, and it depends on specific application. So while Gentoo gives you the possibility to use optimized GCC flags, it will not magically turn your HTPC into a SGI workstation.

Thanks for clarifying. I won't be using distcc, so -march=native should do it for me.
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1576
Location: US

PostPosted: Mon Apr 02, 2012 12:46 pm    Post subject: Reply with quote

gentian,

This will show what flags will be used with -march=native
Code:
gcc -### -march=native -E /usr/include/stdlib.h 2>&1 | grep "/usr/libexec/gcc/.*cc1"
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9464
Location: Córdoba (Spain)

PostPosted: Mon Apr 02, 2012 1:26 pm    Post subject: Reply with quote

blackst0ne wrote:
According http://www.gentoo.org/doc/en/distcc.xml it's not possible to use -march=native and distcc together.

Is it right?


They might work together if all the machines in your network are (and will always be) of the same exact architecture. But I didn't test.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9464
Location: Córdoba (Spain)

PostPosted: Mon Apr 02, 2012 1:33 pm    Post subject: Reply with quote

gentian wrote:
i92guboj wrote:
You can use the flag from the beginning.

"-march=native" won't change anything in your make.conf or elsewhere. It'll just instruct gcc to generate binaries that are 100% compatible with your cpu to -hopefully- use 100% of its capabilities. Those binaries won't run in any other machine unless it has a similar enough cpu.

That "hopefully" statement sounds tad intimidating to me, as I want to have a fast system.. What would the difference be if I use the Cflags mentioned on the cflags reccomendations page for my cpu vs the -march=native?

thx!


Specially if you use the latest and shinniest CPU and gcc still hasn't specific suport for it you might lose some optimizations. I assure you that it wont hurt at all, and gcc will probably catch up in the next update.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Fri Apr 27, 2012 1:05 pm    Post subject: Reply with quote

BillWho wrote:
gentian,

This will show what flags will be used with -march=native
Code:
gcc -### -march=native -E /usr/include/stdlib.h 2>&1 | grep "/usr/libexec/gcc/.*cc1"

This is what I get:

Code:
"/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1" "-E" "-quiet" "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" "-march=amdfam10" "-mcx16" "-msahf" "-mpopcnt" "-mabm" "--param" "l1-cache-size=32" "--param" "l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10"

It's a bit daunting for me to understand which are the ones I need to use..
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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