summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2015-03-31 18:14:30 (GMT)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2015-03-31 18:14:30 (GMT)
commit2a7fe03b5d5d7e1d30a1eb0b0e894eb4f72d3701 (patch)
tree27598a5a8fa961c8b31b335356205edb51d9dbc5
parentd39a3ebe4de834309ed8c67349c86d5a291b75c3 (diff)
parentfe50c502db196a825bf1ebcb93044f5875c2b7df (diff)
downloadcaffeonacl-2a7fe03b5d5d7e1d30a1eb0b0e894eb4f72d3701.zip
caffeonacl-2a7fe03b5d5d7e1d30a1eb0b0e894eb4f72d3701.tar.gz
caffeonacl-2a7fe03b5d5d7e1d30a1eb0b0e894eb4f72d3701.tar.bz2
Merge pull request #2224 from small-yellow-duck/master
[build] check if CPU_ONLY is set when determining CUDA version
-rw-r--r--Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index cb39679..706959a 100644
--- a/Makefile
+++ b/Makefile
@@ -232,13 +232,15 @@ endif
# libstdc++ for NVCC compatibility on OS X >= 10.9 with CUDA < 7.0
ifeq ($(OSX), 1)
CXX := /usr/bin/clang++
- CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release \d' | grep -o '\d')
- ifeq ($(shell echo $(CUDA_VERSION) \< 7.0 | bc), 1)
- CXXFLAGS += -stdlib=libstdc++
- LINKFLAGS += -stdlib=libstdc++
+ ifneq ($(CPU_ONLY), 1)
+ CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release \d' | grep -o '\d')
+ ifeq ($(shell echo $(CUDA_VERSION) \< 7.0 | bc), 1)
+ CXXFLAGS += -stdlib=libstdc++
+ LINKFLAGS += -stdlib=libstdc++
+ endif
+ # clang throws this warning for cuda headers
+ WARNINGS += -Wno-unneeded-internal-declaration
endif
- # clang throws this warning for cuda headers
- WARNINGS += -Wno-unneeded-internal-declaration
# gtest needs to use its own tuple to not conflict with clang
COMMON_FLAGS += -DGTEST_USE_OWN_TR1_TUPLE=1
# boost::thread is called boost_thread-mt to mark multithreading on OS X