# long compile time



## dave-570 (Nov 15, 2016)

Can anyone tell me why it takes hours and hours to compile ports code?


----------



## kpa (Nov 16, 2016)

Because the days of simple and uncomplicated software that can be compiled in matter of minutes are long gone.

Longer and more serious answer is that the FreeBSD project does not develop any of the software in the ports tree (with few notable exceptions) and is at the mercy of upstream developers of the third party software when it comes to deciding what kind of programming languages and tools are needed to compile the software.


----------



## dave-570 (Nov 16, 2016)

Ok, Thanks for your quick reply. I have been building mate desktop and it's taken over 12 hours!! At this writing still not finished!!


----------



## SirDice (Nov 16, 2016)

Why don't you use the packages?


----------



## kpa (Nov 16, 2016)

If you still want to build your own ports take a look at ports-mgmt/poudriere or ports-mgmt/synth, building ports using the plain ports(7) system as documented in the Handbook is going to just cause endless grief.

https://forums.freebsd.org/threads/38859/

https://github.com/jrmarino/synth


----------



## Remington (Nov 16, 2016)

+1 on Poudriere and Synth, both using ccache, will help reduce the time to compile and make upgrades easier with your own options.


----------



## wblock@ (Nov 16, 2016)

devel/ccache does not help at all the first time something is built, and only helps on rebuild if that particular code is still in the cache.

Compiling is a process that takes time.  The FreeBSD cluster compiles ports into binary packages available for download so people are not required to put in that time on their own systems.


----------



## ANOKNUSA (Nov 16, 2016)

dave-570 said:


> I have been building mate desktop and it's taken over 12 hours!!



if you're building a complete desktop environment the compile time is going to be huge no matter what you do. The added convenience of a complete desktop environment is provided by a whole lot of components the user never interacts with, each with their individual dependencies. Plus all the stuff necessary to display a nice graphical interface for individual applications.

I once tried to install Gentoo + KDE on a laptop with an SSD and a 3-GHz quad-core CPU. After about 36 hours I gave up.


----------



## SirDice (Nov 16, 2016)

ANOKNUSA said:


> if you're building a complete desktop environment the compile time is going to be huge no matter what you do.


My measly home server, a Core i5, builds a complete Gnome3 desktop in about 4 hours (That's without ccache and doing a full, clean build). 

So, unless you're building on a Pentium 90 or a Raspberry Pi it really shouldn't take this long.


----------



## sidetone (Nov 17, 2016)

I use ports-mgmt/portmaster, for it to use packages for build-only dependencies. This saves some time, but it still takes long.

Another solution I use, is to use packages for programming languages and other commonly used ports then build ports to my specifications on top of those. That results in saved time, and responsive installs for processing intense programs like Firefox.


----------



## dave-570 (Nov 17, 2016)

SirDice said:


> Why don't you use the packages?


Well, I really thank the people who went to the trouble to pre-build, however what did I learn ?? and in a lot of cases I have used the packages in the past. I don't have a lot of money so I cobbled together a couple of machines and I wanted to see if the actual build on that hardware would make a difference. I did finally get mate to build entirely and I think it does! I've also built Firefox,xfburn, etc. They do run, on these machines, faster and more smoothly. Maybe it's just me, but I'm happy.


----------



## PacketMan (Nov 17, 2016)

I use ports-mgmt/synth pretty much exclusively now. I have configured it to fetch prebuilt packages. If it determines it needs to compile (build) a port then it does, but if the prebuilt package is good, then it downloads it.  When I do a `synth upgrade-system` I would say synth downloads 70% to 90% of the ports using the prebuilt packages, and the rest is compiled.  I have had some opinions where I didn't agree with some things, but when you zoom out and think about it, its a pretty good compromise in the big scheme of things and I am quite content with it.


----------

