-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (40 loc) · 1.89 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
################################################################################
#
# Build script for project
#
################################################################################
# -rdc=true ::: enables relocatable-device-code allows extern keyword to be honored
# --ptxas-opions=-v ::: compilation shows register usage of functions
############################# Makefile ##########################
CUDA_PATH ?= /usr/local/cuda-6.5
CUDA_INC_PATH ?= $(CUDA_PATH)/include
CUDA_BIN_PATH ?= $(CUDA_PATH)/bin
CUDA_LIB_PATH ?= $(CUDA_PATH)/lib64
LDFLAGS := -L$(CUDA_LIB_PATH) -lcuda -lcudart
CPPFLAGS := -g
NVCCFLAGS = -g -G -arch=compute_50 -code=sm_50 -rdc=true --ptxas-options=-v
INCLUDES := -I$(CUDA_INC_PATH) -I. -I.. -I$(CUDA_PATH)/samples/common/inc/
CC = $(CUDA_BIN_PATH)/nvcc
all: main
main.o: main.cu
$(CC) $(CPPFLAGS) $(INCLUDES) -o main.o -c main.cu
LevelSet.o:
$(CC) $(CPPFLAGS) $(INCLUDES) -o LevelSet.o -c LevelSet.cpp
fastmarching.o:
$(CC) $(CPPFLAGS) $(INCLUDES) -o fastmarching.o -c fastmarching.cpp
LevelSetGPU.o:
$(CC) $(CPPFLAGS) $(INCLUDES) -o LevelSetGPU.o -c LevelSetGPU.cu
Example_Kernel.o:
$(CC) $(CPPFLAGS) $(INCLUDES) -o Example_Kernel.o -c Example_Kernel.cu
Signed_Distance_Kernel.o:
$(CC) $(CPPFLAGS) $(INCLUDES) -o Signed_Distance_Kernel.o -c Signed_Distance_Kernel.cu
VoxelsFM_Kernel.o:
$(CC) $(CPPFLAGS) $(INCLUDES) -o VoxelsFM_Kernel.o -c VoxelsFM_Kernel.cu
VelocityFastMarch.o:
$(CC) $(CPPFLAGS) $(INCLUDES) -o VelocityFastMarch.o -c VelocityFastMarch.cu
main: LevelSet.o fastmarching.o main.o LevelSetGPU.o Example_Kernel.o Signed_Distance_Kernel.o VoxelsFM_Kernel.o VelocityFastMarch.o
$(CC) $(NVCCFLAGS) -o main LevelSet.o fastmarching.o LevelSetGPU.o Example_Kernel.o Signed_Distance_Kernel.o VoxelsFM_Kernel.o VelocityFastMarch.o main.o $(LDFLAGS)
run: main
./main
clean:
rm -f main.exe *.o