Optimize generated code with just CPUTYPE

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Optimize generated code with just CPUTYPE

Postby ediondo69 » 05 May 2012, 19:43

Hi, I'm a noob in the FreeBSD world but I like it. If I just add this line to [FILE]/etc/make.conf[/FILE]

Code: Select all
CPUTYPE?= native 


Then [FILE]gcc[/FILE] will set [FILE]-march=native[/FILE] and [FILE]-O2[/FILE] right? Is this simple tuning option enough for a decent output code? May I set [FILE]-O3[/FILE]? I'm confused because some books I've read said that using [FILE]-03[/FILE] will break some ports and the compiler sometimes doesn't detect the right processor, but they were written two or three years ago.

Thank you, English is not my first language.
ediondo69
Junior Member
 
Posts: 3
Joined: 05 May 2012, 19:18

Postby graudeejs » 05 May 2012, 19:53

ediondo69 wrote:Hi, I'm a noob in the FreeBSD world but I like it. If I just add this line to /etc/make.conf

CPUTYPE?= native

Then gcc will set -march=native and -O2 right?



Wrong.
And you don't need to optimize anything (at least while you're noob. When you will not be noob, then you probably won't want to optimize anyway :) )
User avatar
graudeejs
Style(9) Addict
 
Posts: 4591
Joined: 16 Nov 2008, 23:23
Location: Riga, Latvia

Postby ediondo69 » 06 May 2012, 15:16

Thank you very much. I'm sorry for my unformatted first post, I didn't know those rules for posting.
ediondo69
Junior Member
 
Posts: 3
Joined: 05 May 2012, 19:18


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: No registered users and 4 guests