diff --git a/.gitignore b/.gitignore index 00bec14d907..57b0ef0936e 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ data/* # anything under distribute distribute/* + +# user's specified config +Makefile.config diff --git a/INSTALL.md b/INSTALL.md index 66aa794916c..86572333dd2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,12 +2,14 @@ To build and test Caffe do + cp Makefile.config.example Makefile.config make make test make runtest -You may need to minimally tinker with paths in `Makefile.config` and maybe the +You will probably need to adust paths in `Makefile.config` and maybe the `Makefile` itself. +Feel free to issue a pull request for a change that may help other people. Note that building and running CPU-only works, but GPU tests will naturally fail. diff --git a/Makefile.config b/Makefile.config index 111bee99280..7ff8d3dec59 100644 --- a/Makefile.config +++ b/Makefile.config @@ -1,23 +1,31 @@ -# define third-party library paths -# CHANGE YOUR CUDA PATH IF IT IS NOT THIS -CUDA_DIR := /usr/local/cuda -# CHANGE YOUR CUDA ARCH IF IT IS NOT THIS +# CUDA directory contains bin/ and lib/ directories that we need. +CUDA_DIR := /Developer/NVIDIA/CUDA-5.5 + +# CUDA architecture setting. CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ -gencode arch=compute_20,code=sm_21 \ -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 -# CHANGE YOUR MKL PATH IF IT IS NOT THIS + +# MKL directory contains include/ and lib/ directions that we need. MKL_DIR := /opt/intel/mkl -# CHANGE YOUR MATLAB PATH IF IT IS NOT THIS -# your mex binary should be located at $(MATLAB_DIR)/bin/mex + +# NOTE: this is required only if you will compile the matlab interface. +# MATLAB directory should contain the mex binary in /bin MATLAB_DIR := /usr/local -# PUT ALL OTHER INCLUDE AND LIB DIRECTORIES HERE -INCLUDE_DIRS := /usr/local/include /usr/include/python2.7 \ - /usr/local/lib/python2.7/dist-packages/numpy/core/include -LIBRARY_DIRS := /usr/lib /usr/local/lib -# DEFINE THE CXX PATH -CXX=/usr/bin/g++ +# NOTE: this is required only if you will compile the python interface. +# We need to be able to find Python.h and numpy/arrayobject.h. +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 +# We need to be able to find libpythonX.X.so or .dylib. +PYTHON_LIB := /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib + +# Whatever else you find you need goes here. +INCLUDE_DIRS := $(PYTHON_INCLUDES) /usr/local/include +LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib + +# For OS X, use clang++. +CXX=/usr/bin/clang++ BUILD_DIR=build DISTRIBUTE_DIR=distribute diff --git a/Makefile.config.example b/Makefile.config.example new file mode 100644 index 00000000000..dd5b2360765 --- /dev/null +++ b/Makefile.config.example @@ -0,0 +1,32 @@ +# CUDA directory contains bin/ and lib/ directories that we need. +CUDA_DIR := /usr/local/cuda + +# CUDA architecture setting. +CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ + -gencode arch=compute_20,code=sm_21 \ + -gencode arch=compute_30,code=sm_30 \ + -gencode arch=compute_35,code=sm_35 + +# MKL directory contains include/ and lib/ directions that we need. +MKL_DIR := /opt/intel/mkl + +# NOTE: this is required only if you will compile the matlab interface. +# MATLAB directory should contain the mex binary in /bin +MATLAB_DIR := /usr/local + +# NOTE: this is required only if you will compile the python interface. +# We need to be able to find Python.h and numpy/arrayobject.h. +PYTHON_INCLUDES := /usr/include/python2.7 \ + /usr/local/lib/python2.7/dist-packages/numpy/core/include +# We need to be able to find libpythonX.X.so or .dylib. +PYTHON_LIB := /usr/local/lib + +# Whatever else you find you need goes here. +INCLUDE_DIRS := $(PYTHON_INCLUDES) /usr/local/include +LIBRARY_DIRS := $(PYTHON_LIB) /usr/lib /usr/local/lib + +# For OS X, use clang++. +CXX=/usr/bin/g++ + +BUILD_DIR=build +DISTRIBUTE_DIR=distribute