Skip to content


Getting started with MacPorts

I think all Mac developers should get intimately familiar with MacPorts. It really is a pretty good package management system that works. Once you master the basics of installing software, you might ask yourself: What next? In this video, I highlight some features you might not know about.


Getting started with MacPorts from Bryan Liles on Vimeo.

Almost all Mac have multiple cores these days. Why aren’t you taking advantage of it when compiling with MacPorts? The buildmakejobs option in your MacPorts configuration (/opt/local/etc/macports/macports.conf on my box) allows you change the simultaneous jobs you can run at once. I normally use 2n+1 where n is the amount of CPU cores I have.

If long compile times are dragging you down, there are two potential solutions for this in your macports.conf. configureccache and configuredistcc might be just what you are looking for.

ccache caches your compiler output. This can mean huge time savings if you are just updating point releases.

distcc allows you to use other servers to assist you in compiling. I’m not 100% sure how to set this up, but I’m sure there is more information in the MacPorts documentation.

Before enabling ccache or distcc, you should install them using the port command.

Another cool thing you can do with MacPorts is to configure your own local repository. I normally do this when I have specific requirements about the applications I want installed. This situation last came up when I wanted a particular version of ruby.

To keep with the theme of making everything faster, easier and more efficient, I use an alias to install ports.

alias pi='sudo port -v install'

I use the -v because MacPorts is set up to be pretty quiet. Something about scroll lets me know progress is being made.

Finally, don’t forget to sync your ports often. You won’t know about the newest updates if you aren’t syncing often:

sudo port -v sync

And watch the scroll.

Posted in Geek Vids, Smarticus Says.

blog comments powered by Disqus