--- Makefile.orig 2017-08-24 10:09:06.000000000 +0900
+++ Makefile 2017-08-24 10:09:18.000000000 +0900
LIBRARIES := cudart cublas curand
-LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
+LIBRARIES += glog gflags protobuf boost_system-mt boost_filesystem-mt m hdf5_hl hdf5
-PYTHON_LIBRARIES ?= boost_python python2.7
+PYTHON_LIBRARIES ?= boost_python-mt python2.7
WARNINGS := -Wall -Wno-sign-compare
##############################
# libstdc++ for NVCC compatibility on OS X >= 10.9 with CUDA < 7.0
- CXX := /usr/bin/clang++
+ CXX ?= /usr/bin/clang++
CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release [0-9.]*' | tr -d '[a-z ]')
ifeq ($(shell echo | awk '{exit $(CUDA_VERSION) < 7.0;}'), 1)
COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir))
-CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)
+CXXFLAGS += $(_CXXFLAGS) $(COMMON_FLAGS) $(WARNINGS)
NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)
# mex may invoke an older gcc that is too liberal with -Wuninitalized
MATLAB_CXXFLAGS := $(CXXFLAGS) -Wno-uninitialized
# Target for extension-less symlinks to tool binaries with extension '*.bin'.
$(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR)
- @ ln -s $(notdir $<) $@
+ @ cd $(TOOL_BUILD_DIR); ln -s $(notdir $<) $(notdir $@)
$(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME)
@@ -681,19 +681,18 @@ $(DIST_ALIASES): $(DISTRIBUTE_DIR)
$(DISTRIBUTE_DIR): all py | $(DISTRIBUTE_SUBDIRS)
- cp -r src/caffe/proto $(DISTRIBUTE_DIR)/
+ mkdir -p $(DISTRIBUTE_DIR)/share/caffe
+ cp -r src/caffe/proto $(DISTRIBUTE_DIR)/share/caffe/
cp -r include $(DISTRIBUTE_DIR)/
mkdir -p $(DISTRIBUTE_DIR)/include/caffe/proto
cp $(PROTO_GEN_HEADER_SRCS) $(DISTRIBUTE_DIR)/include/caffe/proto
# add tool and example binaries
- cp $(TOOL_BINS) $(DISTRIBUTE_DIR)/bin
- cp $(EXAMPLE_BINS) $(DISTRIBUTE_DIR)/bin
+ for f in $(TOOL_BINS) $(EXAMPLE_BINS); do cp -v "$$f" "$(DISTRIBUTE_DIR)/bin/`basename -s.bin $$f`"; done
cp $(STATIC_NAME) $(DISTRIBUTE_DIR)/lib
install -m 644 $(DYNAMIC_NAME) $(DISTRIBUTE_DIR)/lib
cd $(DISTRIBUTE_DIR)/lib; rm -f $(DYNAMIC_NAME_SHORT); ln -s $(DYNAMIC_VERSIONED_NAME_SHORT) $(DYNAMIC_NAME_SHORT)
# add python - it's not the standard way, indeed...
- cp -r python $(DISTRIBUTE_DIR)/python