Skip to content

Commit

Permalink
Makefile.config removed in favor of .example file
Browse files Browse the repository at this point in the history
with more verbose explanations of paths.
  • Loading branch information
sergeyk committed Feb 3, 2014
1 parent 461175e commit d20cd5c
Showing 4 changed files with 59 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -34,3 +34,6 @@ data/*

# anything under distribute
distribute/*

# user's specified config
Makefile.config
4 changes: 3 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
@@ -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.
34 changes: 21 additions & 13 deletions Makefile.config
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions Makefile.config.example
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d20cd5c

Please sign in to comment.