If you're interested in data science or Kaggle competitions, you probably need the latest version of xgboost. xgboost has been used to win several Kaggle competitions so, without it, you're at a disadvantage.
If you're working on Mavericks and below, you're in luck. You can easily install the latest version of xgboost without having to install gcc.
If you're working on Yosemite and above and have Anaconda installed, you might think xgboost is easy to install for you, too. Unfortunately, the version of xgboost available to the anaconda library at the time of this writing is 0.3. I found out very quickly that there's a big difference in functionality between xgboost 0.3 and 0.6.
The xgboost documentation recommends installing xgboost with pip, another standard Python installer. While I could use anaconda to install pip (since I'd like to keep all my Python packages all under one roof), I couldn't use pip to install xgboost. The error message said something about not being able to find clang and not being able to open an egg.
A search brought me to "Compiling GCC 6 on OS X" by Sol at Solarian Programmer. This and a few other commands were what I needed to install the latest version of xgboost on a Mac running Yosemite. I hope my instructions will help others install the amazing xgboost library.
1. Install GCC according to "Compiling GCC 6 on OS X." I was able to follow the instructions verbatim using Yosemite 10.10.5 and Xcode Version 7.2.1. Besides downloading gcc, you'll also need to download mpc, mpfr, and gmp. It takes about an hour to compile gcc and another hour to make it. I recommend completing the testing part of the article to make sure you've installed everything correctly. Please note that you may use --prefix=/usr/local/gcc instead of --prefix=/usr/local/gcc-6.1.0 to skip Step 3 below.
2. Change the name of the gcc-6.x.x library to gcc if you followed the instructions at "Compiling GCC 6 on OS X" verbatim as I did. If you used gcc instead of any gcc-x.x.x format for the paths in Step 2, skip this step. You'll need the administrator's password to change the name of the directory:
$ sudo mv gcc-6.1.0/ gcc/
3. If you want to keep xgboost within anaconda, travel to anaconda2/bin:
$ cd ~/anaconda2/bin/
4. Git clone xgboost recursively:
$ git clone --recursive https://github.com/dmlc/xgboost
5. Travel to the newly created xgboost directory:
$ cd xgboost
6. Build xgboost:
$ ./build.sh
7. Travel to the python-package directory within the xgboost directory:
$ cd python-package
8. Install xgboost for the local user:
$ python setup.py install --user
That's it. If you were able to complete these instructions, you should have xgboost installed and ready to use.
I took notes after I successfully installed xgboost. If I've forgotten anything, let me know and I'll update this post.