# Which CPUTYPE for Intel Core 2 Duo in laptop?



## Citsakots (Dec 5, 2008)

I'm thinking of copying the example make.conf and ONLY changing the CPUTYPE. From what I've read changing anything else such as the CFLAGS and such isn't going to give much of a performance boost and will inevitably break a port. I have a Toshiba Satellite A200 -FT2 laptop with an Intel Core 2 Duo CPU and in the dmesg it says it is a class 686 CPU so I'm not exactly sure what CPUTYPE to put in. Any help is greatly appreciated.


```
dmesg | grep CPU
CPU: Intel(R) Core(TM) Duo CPU    T5450  @ 1.66GHz (1882.52-MHz 686-class CPU)
```


----------



## gnemmi (Dec 5, 2008)

Take a look at your /usr/share/examples/etc/make.conf file and you'll find that:


```
# The CPUTYPE variable controls which processor should be targeted for
# generated code.  This controls processor-specific optimizations in
# certain code (currently only OpenSSL) as well as modifying the value
# of CFLAGS to contain the appropriate optimization directive to gcc.
# The automatic setting of CFLAGS may be overridden using the
# NO_CPU_CFLAGS variable below.
# Currently the following CPU types are recognized:
#   Intel x86 architecture:
#       (AMD CPUs)      opteron athlon64 athlon-mp athlon-xp athlon-4
#                       athlon-tbird athlon k8 k6-3 k6-2 k6 k5
#       (Intel CPUs)    core2 core nocona pentium4m pentium4 prescott
#                       pentium3m pentium3 pentium-m pentium2
#                       pentiumpro pentium-mmx pentium i486 i386
```

My CPU:


```
[gonzalo@inferna ~]% sysctl hw.model
hw.model: Intel(R) Core(TM)2 Duo CPU     E4500  @ 2.20GHz
```

This is what I'm using:


```
[gonzalo@inferna ~]% grep CPU /etc/make.conf
CPUTYPE?=core2
[gonzalo@inferna ~]%
```

Yet still .. I remember I read somewhere (just can't recall exactly where) that "core2" and "core" were just aliases for "prescott".

Have Fun


----------



## Citsakots (Dec 5, 2008)

gnemmi said:
			
		

> Take a look at your /usr/share/examples/etc/make.conf file and you'll find that:
> 
> 
> ```
> ...


Thank you for your quick and informative reply. I read the example make.conf and I put in core2 for my CPUTYPE but this reassured me greatly in my decision.:stud


----------



## ale (Dec 5, 2008)

gnemmi said:
			
		

> I remember I read somewhere (just can't recall exactly where) that "core2" and "core" were just aliases for "prescott".



/usr/src/share/mk/bsd.cpu.mk ?


----------



## gnemmi (Dec 5, 2008)

good catch


----------



## vermaden (Dec 6, 2008)

You can check that on the Gentoo wiki:
http://en.gentoo-wiki.com/wiki/Safe_Cflags

In your case (Core 2 Duo) it will be:

```
prescott --> 32bit (i386)
nacona   --> 64bit (amd64)
```


----------



## Citsakots (Dec 6, 2008)

vermaden said:
			
		

> You can check that on the Gentoo wiki:
> http://en.gentoo-wiki.com/wiki/Safe_Cflags
> 
> In your case (Core 2 Duo) it will be:
> ...



Hmm. So I'm putting the CPUTYPE as "CPUTYPE?=core2" in make.conf and I'm assuming this is the same as putting the CPUTUPE to prescott. Is this correct? Also do you guys think I should leave in the question mark or not? I left it in just to be safe.


----------



## vermaden (Dec 6, 2008)

Citsakots said:
			
		

> Hmm. So I'm putting the CPUTYPE as "CPUTYPE?=core2" in make.conf and I'm assuming this is the same as putting the CPUTUPE to prescott. Is this correct?



Yes, both are correct, core2 will just be translated into prascott or nacona depends which ARCH you use. GCC 4.2 (the one which FreeBSD currently use) does not support core2 flag/optimizations, but gcc 4.3 does have a separate profile for core2 flag.



			
				Citsakots said:
			
		

> Also do you guys think I should leave in the question mark or not? I left it in just to be safe.


I used CPUTYPE=... as long as I remember, but maybe someone had some problems because of the lack of '?', let them speak for themselves, 'cause I did not had problems with it. Maybe its little more historic, like using -O -pipe instead of -O2 ... in older FreeBSD releases because it will not build.


----------



## Djn (Dec 6, 2008)

I've had problems with it quite recently, though I can't remember what I was building.
I seem to remember that ?= means "set if not already set", so I would guess it is like that to allow overriding it with an environment variable.


----------



## gnemmi (Dec 6, 2008)

```
[gonzalo@inferna ~]% grep "?=" /usr/share/examples/etc/make.conf
# (?= allows to buildworld for a different CPUTYPE.)
```

So basically .. it doesn hurt to use "?=" ...
It's kinda like a preemtive measure ... just in case .. you never know


----------



## kamikaze (Dec 8, 2008)

I think that there might be ports that need to override it with more conservative values. Any way, you won't have to change your make.conf if you crossbuild stuff if you use ?=.


----------

