View previous topic :: View next topic |
Author |
Message |
imag1narynumber n00b
Joined: 17 Dec 2009 Posts: 3
|
Posted: Fri Dec 18, 2009 9:47 pm Post subject: Safe Cflags to Use for My Celeron [solved] |
|
|
Hello,
I recently tried to install Gentoo on my new notebook and failed. I'm gearing up for another attempt, but this time I'll try to be a bit more exacting. Upon looking on http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel for my processor, I don't see it listed. Here's my info:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Celeron(R) CPU 900 @ 2.20GHz
stepping : 10
cpu MHz : 2194.397
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx lm constant_tsc up arch_perfmon pebs bts pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm
bogomips : 4388.79
clflush size : 64
power management:
Any ideas as to what to use? Thanks in advance for your help.
Last edited by imag1narynumber on Sat Dec 19, 2009 2:43 pm; edited 1 time in total |
|
Back to top |
|
|
alunduil Retired Dev
Joined: 13 Mar 2005 Posts: 96 Location: San Antonio, TX, USA
|
Posted: Fri Dec 18, 2009 9:52 pm Post subject: |
|
|
-march=native -O2 -pipe -fomit-frame-pointer -msse2 -mmmx -mssse3
Should work well for you.
Regards,
Alunduil |
|
Back to top |
|
|
imag1narynumber n00b
Joined: 17 Dec 2009 Posts: 3
|
Posted: Sat Dec 19, 2009 2:42 pm Post subject: |
|
|
Excellent, thanks very much for your help!
Is there a way that I would've been able to figure this out on my own? |
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Sat Dec 19, 2009 4:37 pm Post subject: |
|
|
The new Gentoo Linux Wiki - Safe Cflags which can be found via google, sometimes provides some reasonably good information for some things.
The very best documentation resource place to start is always right here, and here, and here. |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Sat Dec 19, 2009 5:06 pm Post subject: |
|
|
Are you sure that -march=native will not detect properly the Celeron and -msse2 -mmmx -mssse3 are actually not needed ? |
|
Back to top |
|
|
zyko l33t
Joined: 01 Jun 2008 Posts: 620 Location: Munich, Germany
|
Posted: Sat Dec 19, 2009 8:15 pm Post subject: |
|
|
Quote: | Are you sure that -march=native will not detect properly the Celeron and -msse2 -mmmx -mssse3 are actually not needed ? |
-march=native doesn't enable instructions like mmx/sse, because doing so on a global scale breaks some stuff. Packages that profit from extended instruction sets usually have some mechanism of auto-detection (e.g. mplayer), or at least their ebuild offers specific USE flags for mmx/sse.
So best practice would be to leave extended instruction sets out of the $CFLAGS variable and instead enable the correct USE flags. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
zyko l33t
Joined: 01 Jun 2008 Posts: 620 Location: Munich, Germany
|
Posted: Sun Dec 20, 2009 10:58 am Post subject: |
|
|
Quote: | That's interesting. What's the whole idea of having different -march options for i686 then? |
I was unclear above. -march={your-CPU} does enable extended instruction sets, no worries there.
The option "-march=native" will usually manipulate some of gcc's -m options to match your CPU. It will however not touch the -m options related to extended instruction sets, so that "-march=native" does not imply -mmmx -msse in CPUs that support mmx and sse. You can test this by running "gcc -Q -march=native --help=target".
When you run gcc with -march=native, it is usually the same as running it with -march={your-actual-CPU}, so it does emit code that uses optimized scheduling, ABI and all supported instructions pertaining to your respective CPU architecture. So extended instruction sets are in fact enabled by just setting the correct -march option! This is still not the same as specifically forcing the -m options related to instructions (-mmmx -msse etc.) in your $CFLAGS. There are subtle differences that may break some compiles. This is especially true for packages that come with more complex build scripts which need to detect CPU features themselves and enable/disable gcc options accordingly.
The only -m option you should ever touch in /etc/make.conf is -march (or -mtune, which is a subset of -march)! If you manipulate any other -m options, you better know exactly why you are doing so, which usually implies some deeper knowledge of the code to be compiled. You better leave that to upstream developers and ebuild maintainers.
Nowadays on Gentoo, almost nothing ever fails because of wrong $CFLAGS, since ebuild developers override your settings any time there is even the slightest possibility that you might break something. It's still bad practice to just enable overly specific options on a global scale. |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Sun Dec 20, 2009 4:18 pm Post subject: |
|
|
That's why nowadays we see a lot of this inside the forum :
Code: |
CFLAGS="-O2 -march=native -pipe"
|
No more extra optimization, we let GCC enable what it wants. |
|
Back to top |
|
|
imag1narynumber n00b
Joined: 17 Dec 2009 Posts: 3
|
Posted: Mon Dec 21, 2009 6:15 pm Post subject: |
|
|
Wow. While I am not going to say I've followed everything, that was pretty enlightening. Thanks for all of your help. |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Tue Dec 22, 2009 12:57 am Post subject: |
|
|
No problem, good luck |
|
Back to top |
|
|
|