Skip to content
Snippets Groups Projects
Commit 4dcdd3f3 authored by cmaffeo2's avatar cmaffeo2
Browse files

Makefile logic to decide C std

parent 7352affc
No related branches found
No related tags found
No related merge requests found
......@@ -31,22 +31,32 @@ CC_FLAGS += -DVERSION="\"$(VERSION)\"" -DSIGNAL
CC_FLAGS += -I$(CUDA_PATH)/include
CC_FLAGS += -Wall -Wno-write-strings -std=c++14 -pedantic# TODO: test on Mac OSX and other architectures
CC_FLAGS += -Wall -Wno-write-strings -pedantic# TODO: test on Mac OSX and other architectures
ifeq ($(dbg),1)
NV_FLAGS += -lineinfo
else
NV_FLAGS += -lineinfo
endif
CUDA_VERSION_GT10 = $(shell expr `nvcc -V | tr 'V' ' ' | tr ' ' '\n' | tail -n1 | cut -f1 -d.` \> 10)
ifeq "$(CUDA_VERSION_GT10)" "1"
CSTD:=c++14
else
CSTD:=c++11
endif
NV_FLAGS := $(NV_FLAGS) -std=$(CSTD)
ifneq ($(DARWIN),)
LIBRARY = $(CUDA_PATH)/lib
LIBRARY = $(CUDA_PATH)/lib
else
LIBRARY = $(CUDA_PATH)/lib64
LIBRARY = $(CUDA_PATH)/lib64
ifeq "$(CSTD)" "c++11"
CSTD := c++1y
endif
endif
CC_FLAGS += -std=$(CSTD)
# NV_FLAGS += -ftz=true # TODO: test if this preserves accurate simulation
$(info $(NVCC))
## Find valid compute capabilities for this machine
SMS ?= 30 35 37 50 52 60 61
$(info Testing CUDA toolkit with compute capabilities SMS='$(SMS)')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment