-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (29 loc) · 1.04 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
TLPI_PATH ?= /home/lixun/Dropbox/PhD/tlpi-dist
CUDA_PATH ?= /usr/local/cuda
CUDA_SDK_PATH ?= /usr/local/cuda/samples/common/inc
HOST_COMPILER ?= gcc
NVCC := $(CUDA_PATH)/bin/nvcc -ccbin $(HOST_COMPILER)
MACRO = -D$(MODEL)
ifeq ($(verbose),1)
MACRO += -DVERBOSE
endif
ifeq ($(write),1)
MACRO += -DWR2FILE
endif
all: main SI_gpu
main.o: main.c
gcc -I$(TLPI_PATH)/lib -L$(TLPI_PATH) $(MACRO) -o $@ -c $< -ltlpi
main: main.o model_$(MODEL).o
gcc -I$(TLPI_PATH)/lib -L$(TLPI_PATH) -o $@ $^ -lrt -ltlpi -lm
model_VAR.o: model_VAR.c model_VAR.h
gcc -I$(TLPI_PATH)/lib -L$(TLPI_PATH) -o $@ -c $< -lrt -ltlpi
model_triv.o: model_triv.c model_triv.h
$(NVCC) -I$(TLPI_PATH)/lib -L$(TLPI_PATH) -o $@ -c $< -lrt -ltlpi -lm
model_EKD.o: model_EKD.c model_EKD.h
gcc -I$(TLPI_PATH)/lib -L$(TLPI_PATH) -o $@ -c $< -lrt -ltlpi
SI_gpu: SI_gpu.o model_$(MODEL).o
$(NVCC) -I$(TLPI_PATH)/lib -L$(TLPI_PATH) -o $@ $^ -ltlpi -lrt -lm -lcurand
SI_gpu.o: SI_gpu.cu
$(NVCC) -I$(TLPI_PATH)/lib -L$(TLPI_PATH) $(MACRO) -o $@ -c $< -ltlpi
clean:
rm -f main *.o SI_gpu