diff options
author | small-yellow-duck <kiri.nichol@gmail.com> | 2015-03-29 14:30:21 -0700 |
---|---|---|
committer | small-yellow-duck <> | 2015-03-29 14:36:16 -0700 |
commit | fe50c502db196a825bf1ebcb93044f5875c2b7df (patch) | |
tree | 3a4f46eeab831d04741b5ad1466105b2949c4053 /Makefile | |
parent | 12f559e9bddad1e5a6a7ecd0cdaf74fbbb726965 (diff) | |
download | caffeonacl-fe50c502db196a825bf1ebcb93044f5875c2b7df.tar.gz caffeonacl-fe50c502db196a825bf1ebcb93044f5875c2b7df.tar.bz2 caffeonacl-fe50c502db196a825bf1ebcb93044f5875c2b7df.zip |
Check if CPU_ONLY is set when determining CUDA version
Previously, CUDA_VERSION would appear to be < 7 if there was no CUDA
installed, and that would generate the wrong C++ flags for compiling on
recent OSX versions. Instead, skip the CUDA version check if CPU_ONLY is
set. This change only affects CPU_ONLY installations.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 |