We mostly used Ubuntu 12.04 for development, and here we describe the
step-to-step guide on installing Caffe on Ubuntu.
+We have also successfully compiled caffe on OS X 10.8.5, using homebrew-installed libraries.
## Prerequisites
To use Caffe with python, you will need to add `/path/to/caffe/python` or `/path/to/caffe/build/python` to your `PYTHONPATH`.
Now that you have compiled Caffe, check out the [MNIST demo](mnist.html) and the pretrained [ImageNet example](imagenet.html).
+
+## Compiling on OS X.
+
+OS X 10.9 (Mavericks) is currently not supported, because current (5.5) CUDA compilers link against libstdc++, while 10.9 compilers link against libc++.
+On 10.8, we have successfully compiled and run caffe on GPU-equipped Macbook Pros.
+
+From a clean install of the OS (or from a wiped `/usr/local`), install [homebrew](http://brew.sh/), then `brew install python`, then `brew install boost --build_from_source`.
+The reason to build boost from source is so that it links against the homebrew python.
+Homebrew handles all the other dependencies as well: `opencv`, `leveldb`, etc.
+For python packages like `numpy` and `scipy`, we recommend doing `brew tap homebrew/python`, and then installing them with homebrew.
+CUDA and MKL are very straightforward to install; download from NVIDIA and Intel websites.
+
+Here are the relevant parts of the Makefile.config after all this:
+
+ CUDA_DIR := /Developer/NVIDIA/CUDA-5.5
+ MKL_DIR := /opt/intel/mkl
+ PYTHON_INCLUDES := /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7 /usr/local/lib/python2.7/site-packages/numpy/core/include
+ PYTHON_LIB := /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib
+ CXX=/usr/bin/clang++
+
+Don't forget to set `PATH` and `LD_LIBRARY_PATH`:
+
+ export PATH=/Developer/NVIDIA/CUDA-5.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
+ export LD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-5.5/lib:/opt/intel/composer_xe_2013_sp1.1.103/compiler/lib:/opt/intel/composer_xe_2013_sp1.1.103/mkl/lib:/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib:/usr/local/lib:/usr/lib:/lib
+
+Additionally, MKL requires `DYLD_LIBRARY_PATH` to be set:
+
+ export MKL_DIR=/opt/intel/composer_xe_2013_sp1.1.103
+ export DYLD_LIBRARY_PATH=$MKL_DIR/compiler/lib:$MKL_DIR/mkl/lib
+
+Note that we still need to include the MKL `compiler/lib` in our paths, although we do not explicitly link against this directory in the Makefile.