configure Makefile for CPU-only build

This commit is contained in:
Evan Shelhamer 2014-06-29 20:45:41 -07:00
Родитель 53825cd3c7
Коммит b6d881d1e7
2 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -202,6 +202,16 @@ ifeq ($(LINUX), 1)
endif
endif
# CPU-only configuration
ifeq ($(CPU_ONLY), 1)
OBJS := $(PROTO_OBJS) $(CXX_OBJS)
TEST_OBJS := $(TEST_CXX_OBJS)
TEST_BINS := $(TEST_CXX_BINS)
ALL_WARNS := $(ALL_CXX_WARNS)
TEST_FILTER := --gtest_filter="-*GPU*:*/2.*:*/3.*"
COMMON_FLAGS += -DCPU_ONLY
endif
# OS X:
# clang++ instead of g++
# libstdc++ instead of libc++ for CUDA compatibility on 10.9
@ -222,9 +232,9 @@ endif
# Debugging
ifeq ($(DEBUG), 1)
COMMON_FLAGS := -DDEBUG -g -O0
COMMON_FLAGS += -DDEBUG -g -O0
else
COMMON_FLAGS := -DNDEBUG -O2
COMMON_FLAGS += -DNDEBUG -O2
endif
# BLAS configuration (default = ATLAS)
@ -342,7 +352,7 @@ $(MAT$(PROJECT)_SO): $(MAT$(PROJECT)_SRC) $(STATIC_NAME)
@ echo
runtest: $(TEST_ALL_BIN)
$(TEST_ALL_BIN) $(TEST_GPUID) --gtest_shuffle
$(TEST_ALL_BIN) $(TEST_GPUID) --gtest_shuffle $(TEST_FILTER)
runtestnogpu: $(TEST_ALL_BIN)
$(TEST_ALL_BIN) --gtest_shuffle --gtest_filter="-*GPU*:*/2.*:*/3.*"

Просмотреть файл

@ -1,6 +1,9 @@
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++