Homebrew is a package manager of OSX that makes installing tools and libraries a breeze.

The installation of the tools is explained on their website.