# Tuning FreeBSD 9.x



## kr651129 (Feb 27, 2012)

I've come accross this link that explains how to fine tune different aspects of a FreeBSD system.  My question is, this is for 4.x and 5.x how relevant would this information be for a 9.x build?  And if it isn't where should I go to read about this?

I'm interested in the optimizing software compiling section since this is a fresh install I would like to get this down before I install to many ports.

Thank you.


----------



## wblock@ (Feb 27, 2012)

That article suggests setting CFLAGS, which usually provides no performance improvement and often causes problems.  Some ports try to use custom CFLAGS, and setting global CFLAGS values will prevent that, actually making them slower.

Setting CPUTYPE in /etc/make.conf does no harm, and may improve things.  A system compiled that way would then require that processor at minimum, so moving that disk to another system would be more complicated.


----------



## kr651129 (Feb 28, 2012)

Awesome, that's good info to know 

While we're on the subject of compiling and you're a developer maybe you can answer something for me.  I've noticed a lot of Fedora rpm's when compiling ports.  Is there a reason that FreeBSD decided this code over others?


----------



## kpa (Feb 28, 2012)

They were probably the easiest to use Linux  packages at time those ports were created. As far as I know there's nothing in the linux(4) emulation layer that forces the use of binaries from a certain Linux distro, they could be from the latest Debian if someone did the work to create equivalent ports using them. Oh and I doubt it was FreeBSD (if you are thinking about the foundation) that made the decision but the port maintainers.


----------



## SirDice (Feb 28, 2012)

kr651129 said:
			
		

> And if it isn't where should I go to read about this?


See tuning(7).


----------



## kr651129 (Feb 28, 2012)

So what's better for installing ports -- compile from the ports tree or pkg_add the binary?


----------



## SirDice (Feb 28, 2012)

kr651129 said:
			
		

> compile from the ports tree or pkg_add the binary?


Compiling from ports is the recommended strategy.


----------



## SirDice (Feb 28, 2012)

kr651129 said:
			
		

> While we're on the subject of compiling and you're a developer maybe you can answer something for me.  I've noticed a lot of Fedora rpm's when compiling ports.  Is there a reason that FreeBSD decided this code over others?


There used to be various different linux_base ports. Most of them have been removed because they where unmaintained and didn't work properly with the later versions of the linux emulation layer.

http://www.freshports.org/search.ph...erby=category&orderbyupdown=asc&search=Search


----------



## ManaHime (Feb 28, 2012)

SirDice said:
			
		

> Compiling from ports is the recommended strategy.




Doesn't that depends of what you want? I mean, if someone just want the program and doesn't care about special options does it really changes anything whether it as installed from packages or ports?


----------



## Carpetsmoker (Feb 28, 2012)

^ Exactly.

There is *no* difference between a package and a port. A package is just a tar archive of the files a port installs.


----------



## kr651129 (Feb 29, 2012)

So, as an example let's say I'm compiling the empathy port. Everything works fine until I receive an error with a dependency that was trying to be installed. I fix the error then try to continue the compile, even after a make clean it still gives me the same error. How do I fix this? I dont have a more specific example because I'm on the road on my tablet.


----------



## DutchDaemon (Feb 29, 2012)

This is going _way_ off-topic. Moreover, the _ports v packages_ topic has been done numerous times. Please wrap this one up and/or open a new thread with specific information (and in the proper sub-forum).


----------

