[MRG] Use ccache on Travis
diff --git a/.travis.yml b/.travis.yml
index a0740180adbfb..3bdf91f4ab4d4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,7 @@ cache:
   apt: true
   directories:
   - $HOME/.cache/pip
+  - $HOME/.ccache
 
 dist: trusty
 
diff --git a/build_tools/travis/install.sh b/build_tools/travis/install.sh
index fe0d46821e29d..257cfb17f3938 100755
--- a/build_tools/travis/install.sh
+++ b/build_tools/travis/install.sh
@@ -13,15 +13,16 @@
 
 set -e
 
-# Fix the compilers to workaround avoid having the Python 3.4 build
-# lookup for g++44 unexpectedly.
-export CC=gcc
-export CXX=g++
-
 echo 'List files from cached directories'
 echo 'pip:'
 ls $HOME/.cache/pip
 
+export CC=/usr/lib/ccache/gcc
+export CXX=/usr/lib/ccache/g++
+# Useful for debugging how ccache is used
+# export CCACHE_LOGFILE=/tmp/ccache.log
+# ~60M is used by .ccache when compiling from scratch at the time of writing
+ccache --max-size 100M --show-stats
 
 if [[ "$DISTRIB" == "conda" ]]; then
     # Deactivate the travis-provided virtual environment and setup a
@@ -99,8 +100,10 @@ try:
 except ImportError:
     pass
 "
-
     python setup.py develop
+    ccache --show-stats
+    # Useful for debugging how ccache is used
+    # cat $CCACHE_LOGFILE
 fi
 
 if [[ "$RUN_FLAKE8" == "true" ]]; then

Use ccache and add .ccache to the Travis cache. This should save 2-4 minutes of compilation on each build that builds scikit-learn.

In some tests on Travis there seems to be some variability but here is what I found (I used `time python setup.py develop` to have a better idea about the timings):
* when ccache is working `python setup.py develop` takes 45s-1min (cython compilation)
* without ccache it is about 3-5 min (cython compilation + compilation of generated .c and .cpp files

I tried many different things but for some reason just using "export PATH=/usr/lib/ccache:$PATH" as I do locally does not seem to be enough ...