Download latest version of XCode
Open Terminal Session
enter the following: xcode-select –install
This will prompt you to install the command line developer tools

click install
Download the latest gnu compilers from here latest archive of the GNU compilers
in terminal cd to your downloads folder containing the downloaded file
run the following command: sudo tar xvf gcc-
4.9
-bin.tar -C /
edit your .bash_profile and add the following entry
export PATH=/usr/local/bin:$PATH
in the terminal enter: xcode-select –switch <path to Xcode.app>