Building Caffe from source is easy. There are two options provided: using a Makefile or using CMake. I found that using Makefile was easier, since CMake was erroneously complaining about
-lpthreads (which is a Clang library, not a GCC library).
- Download or clone the source code of Caffe from here.
Copy the Makefile config file, open it in an editor and check whether all the paths are set correctly:
$ cp Makefile.config.example Makefile.config $ vim Makefile.config
- To build Caffe:
$ make all
Building support for MATLAB to use Caffe takes a few more steps:
In Makefile.config, set the
MATLAB_DIRto the path that contains
bin/mex. On my computer, this was the path
Compiling the MATLAB wrapper gave an error about C++11 on my Ubuntu 14.04 due to the older GCC compilers. So, I had to add
Makefileas shown here.
Finally, compiling MatCaffe is easy:
$ make all matcaffe