Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TEST_GPUID := 0
# define third-party library paths
# CHANGE YOUR CUDA PATH IF IT IS NOT THIS
CUDA_DIR := /usr/local/cuda
# CUDA_DIR := /Developer/NVIDIA/CUDA-5.5
# CHANGE YOUR CUDA ARCH IF IT IS NOT THIS
CUDA_ARCH := -arch=sm_30
# CHANGE YOUR MKL PATH IF IT IS NOT THIS
Expand Down Expand Up @@ -73,7 +74,7 @@ TEST_BINS := ${TEST_OBJS:.o=.testbin}
# Derive include and lib directories
##############################
CUDA_INCLUDE_DIR := $(CUDA_DIR)/include
CUDA_LIB_DIR := $(CUDA_DIR)/lib64
CUDA_LIB_DIR := $(CUDA_DIR)/lib $(CUDA_DIR)/lib64
MKL_INCLUDE_DIR := $(MKL_DIR)/include
MKL_LIB_DIR := $(MKL_DIR)/lib $(MKL_DIR)/lib/intel64

Expand All @@ -85,9 +86,11 @@ LIBRARIES := cudart cublas curand protobuf opencv_core opencv_highgui \
PYTHON_LIBRARIES := boost_python python2.7
WARNINGS := -Wall

# NOTE: on OS X, use clang++ to have NVCC play nice.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move these 2 likes above - near the CUDA_DIR definition and stuff, since we may need to change it on different platforms?

(We should probably figure out how to write separate config files instead of modifying Makefile for paths... Any advice?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option to split Makefile into Makefile and Makefile.config. We'd place
variables like *_DIR, CXX, etc. which are likely to change on different
computers in Makefile.config, and then include Makefile.config at the top
of Makefile. That way, hopefully only Makefile.config needs to be edited.
Another option is to figure out how to use automake/autoconf or cmake
properly :/. These tools always seem like complicated overkill, but maybe
they're the right way to go.

Ross

On Tue, Nov 26, 2013 at 7:54 AM, Yangqing Jia notifications@github.comwrote:

In Makefile:

@@ -85,9 +86,11 @@ LIBRARIES := cudart cublas curand protobuf opencv_core opencv_highgui
PYTHON_LIBRARIES := boost_python python2.7
WARNINGS := -Wall

+# NOTE: on OS X, use clang++ to have NVCC play nice.

Could you move these 2 likes above - near the CUDA_DIR definition and
stuff, since we may need to change it on different platforms?

(We should probably figure out how to write separate config files instead
of modifying Makefile for paths... Any advice?)


Reply to this email directly or view it on GitHubhttps://github.com/Yangqing/caffe/pull/5/files#r7928356
.

http://www.cs.berkeley.edu/~rbg/

CXX := /usr/bin/c++
COMMON_FLAGS := -DNDEBUG $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir))
CXXFLAGS += -pthread -fPIC -O2 $(COMMON_FLAGS)
NVCCFLAGS := -Xcompiler -fPIC -O2 $(COMMON_FLAGS)
NVCCFLAGS := -ccbin=$(CXX) -Xcompiler -fPIC -O2 $(COMMON_FLAGS)
LDFLAGS += $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) \
$(foreach library,$(LIBRARIES),-l$(library)) \
-Wl,-rpath,../lib/
Expand Down