-
Notifications
You must be signed in to change notification settings - Fork 44
/
Main.mk
77 lines (64 loc) · 1.7 KB
/
Main.mk
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
65
66
67
68
69
70
71
72
73
74
75
76
ifeq ($(USE_NNFORGE),yes)
ifeq ($(ENABLE_CUDA_BACKEND),yes)
LDLIBSDEPEND+=-lnnforge_cuda
GENERIC_CXXFLAGS+=-DNNFORGE_CUDA_BACKEND_ENABLED
endif
GENERIC_CXXFLAGS+=-I$(NNFORGE_PATH)
LDLIBSDEPEND+=-lnnforge_plain -lnnforge
VPATH+=$(NNFORGE_PATH)/lib
LDFLAGS+=-L$(NNFORGE_PATH)/lib
endif
ifeq ($(USE_BOOST),yes)
ifneq ($(BOOST_PATH),)
GENERIC_CXXFLAGS+=-I$(BOOST_PATH)/include
LDFLAGS+=-L$(BOOST_PATH)/lib
endif
LDFLAGS+=$(BOOST_LIBS)
endif
ifeq ($(USE_PROTOBUF),yes)
ifneq ($(PROTOBUF_PATH),)
GENERIC_CXXFLAGS+=-I$(PROTOBUF_PATH)/include
LDFLAGS+=-L$(PROTOBUF_PATH)/lib
endif
LDFLAGS+=$(PROTOBUF_LIBS)
endif
ifeq ($(USE_CUDA),yes)
GENERIC_CXXFLAGS+=-I$(CUDA_PATH)/include -I$(CUDNN_PATH)/include
LDFLAGS+=-L$(CUDA_PATH)/lib64 -L$(CUDA_PATH)/lib -L$(CUDNN_PATH)/lib64 $(CUDA_LIBS)
endif
ifeq ($(USE_OPENCV),yes)
ifneq ($(OPENCV_PATH),)
GENERIC_CXXFLAGS+=-I$(OPENCV_PATH)/include
LDFLAGS+=-L$(OPENCV_PATH)/lib
endif
LDFLAGS+=$(OPENCV_LIBS)
endif
ifeq ($(USE_OPENMP),yes)
GENERIC_CXXFLAGS+=$(CPP_FLAGS_OPENMP)
LDFLAGS+=$(LD_FLAGS_OPENMP)
endif
GENERIC_CXXFLAGS+=$(CPP_FLAGS_COMMON)
ifeq ($(BUILD_MODE),debug)
GENERIC_CXXFLAGS+=$(CPP_FLAGS_DEBUG_MODE)
else
GENERIC_CXXFLAGS+=$(CPP_FLAGS_RELEASE_MODE)
endif
NVCCFLAGS=$(CUDA_FLAGS_COMMON)
ifeq ($(BUILD_MODE),debug)
NVCCFLAGS+=$(CUDA_FLAGS_DEBUG_MODE)
else
NVCCFLAGS+=$(CUDA_FLAGS_RELEASE_MODE)
endif
ifeq ($(ENABLE_CUDA_PROFILING),yes)
NVCCFLAGS+=-DENABLE_CUDA_PROFILING
GENERIC_CXXFLAGS+=-DENABLE_CUDA_PROFILING
LDFLAGS+=-lnvToolsExt
endif
ifeq ($(NNFORGE_USE_NCCL),yes)
GENERIC_CXXFLAGS+=-I$(NCCL_PATH)/include -DNNFORGE_USE_NCCL
LDFLAGS+=-L$(NCCL_PATH)/lib -lnccl
endif
NVCCFLAGS+=-Xcompiler="$(GENERIC_CXXFLAGS)"
CXXFLAGS=$(GENERIC_CXXFLAGS)
CXXFLAGS+=-std=c++11
ARFLAGS=rcvus