-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
50 lines (40 loc) · 1.2 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CPP :=g++
NVCC :=/usr/local/cuda/bin/nvcc
INC :=
LIBS :=-llapacke -lopenblas -lboost_program_options
ARCHES :=-gencode arch=compute_70,code=\"compute_70,sm_70\"
SRCDIR :=src
OBJDIR :=obj
APP :=filters
CFLAGS :=-std=c++14 -O3 --use_fast_math
NVTX :=
ifdef NVTX # NVTX labeling/profiling
CFLAGS += -DUSE_NVTX
endif
# Add inputs and outputs from these tool invocations to the build variables
SOURCES := command_line_options \
filters \
generate_data \
particle_bpf_cpu \
particle_bpf_gpu
OBJECTS +=$(addprefix $(OBJDIR)/, $(SOURCES:%=%.o))
# All Target
all: build $(APP)
build:
@mkdir -p $(OBJDIR)
$(APP): $(OBJECTS)
@echo 'Building target: $@'
@echo 'Invoking: NVCC linker'
$(NVCC) --cudart=static -ccbin $(CPP) $(ARCHES) -o $@ $(OBJECTS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
$(OBJDIR)/%.o: ./$(SRCDIR)/%.cpp
$(NVCC) -x cu $(INC) -ccbin $(CPP) $(CFLAGS) $(ARCHES) -c -o "$@" "$<" --expt-relaxed-constexpr
$(OBJDIR)/%.o: ./$(SRCDIR)/%.cu
$(NVCC) $(INC) -ccbin $(CPP) $(CFLAGS) $(ARCHES) -c -o "$@" "$<" --expt-relaxed-constexpr
clean:
@echo 'Cleaning up...'
@echo 'rm -rf $(OBJDIR)/*.o $(APP)'
@echo ' '
@rm -rf $(OBJDIR)/*.o $(APP)
.PHONY: all build clean