Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Safe Cflags to Use for My Celeron [solved]
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
imag1narynumber
n00b
n00b


Joined: 17 Dec 2009
Posts: 3

PostPosted: Fri Dec 18, 2009 9:47 pm    Post subject: Safe Cflags to Use for My Celeron [solved] Reply with quote

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
View user's profile Send private message
alunduil
Retired Dev
Retired Dev


Joined: 13 Mar 2005
Posts: 96
Location: San Antonio, TX, USA

PostPosted: Fri Dec 18, 2009 9:52 pm    Post subject: Reply with quote

-march=native -O2 -pipe -fomit-frame-pointer -msse2 -mmmx -mssse3

Should work well for you.

Regards,

Alunduil
Back to top
View user's profile Send private message
imag1narynumber
n00b
n00b


Joined: 17 Dec 2009
Posts: 3

PostPosted: Sat Dec 19, 2009 2:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Sat Dec 19, 2009 4:37 pm    Post subject: Reply with quote

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


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sat Dec 19, 2009 5:06 pm    Post subject: Reply with quote

Are you sure that -march=native will not detect properly the Celeron and -msse2 -mmmx -mssse3 are actually not needed ?
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Sat Dec 19, 2009 8:15 pm    Post subject: Reply with quote

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


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Dec 19, 2009 8:47 pm    Post subject: Reply with quote

That's interesting. What's the whole idea of having different -march options for i686 then?
I have a VIA C7 here. When -march is set to native the actual option gcc uses is prescott.

http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options

Quote:
prescott
Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction set support.

:?:
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Sun Dec 20, 2009 10:58 am    Post subject: Reply with quote

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


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sun Dec 20, 2009 4:18 pm    Post subject: Reply with quote

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


Joined: 17 Dec 2009
Posts: 3

PostPosted: Mon Dec 21, 2009 6:15 pm    Post subject: Reply with quote

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


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Tue Dec 22, 2009 12:57 am    Post subject: Reply with quote

No problem, good luck :P
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