forked from Ericwimsatt/cqf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (81 loc) · 2.9 KB
/
Makefile
File metadata and controls
125 lines (81 loc) · 2.9 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
TARGETS=test gqf_verify
ifdef D
DEBUG=-g -G
OPT=
else
DEBUG=
OPT=-O3
endif
ifdef NH
ARCH=
else
ARCH=-msse4.2 -D__SSE4_2_
endif
ifdef P
PROFILE=-pg -no-pie # for bug in gprof.
endif
LOC_INCLUDE=include
LOC_SRC=src
LOC_TEST=test
OBJDIR=obj
CC = gcc -std=gnu11
CXX = g++ -std=c++11
CU = nvcc -dc -x cu
LD = nvcc
CXXFLAGS = -Wall $(DEBUG) $(PROFILE) $(OPT) $(ARCH) -m64 -I. -Iinclude
CUFLAGS = $(DEBUG) -arch=sm_70 -rdc=true -I. -Iinclude
CUDALINK = -L/usr/common/software/sles15_cgpu/cuda/11.1.1/lib64/compat -L/usr/common/software/sles15_cgpu/cuda/11.1.1/lib64 -L/usr/common/software/sles15_cgpu/cuda/11.1.1/extras/CUPTI/lib6 -lcurand --nvlink-options -suppress-stack-size-warning
LDFLAGS = $(DEBUG) $(PROFILE) $(OPT) $(CUDALINK) -arch=sm_70 -lpthread -lssl -lcrypto -lm -lcuda -lcudart
#
# declaration of dependencies
#
all: $(TARGETS)
# dependencies between programs and .o files
cluster_length_test: $(OBJDIR)/cluster_length_test.o $(OBJDIR)/gqf.o \
$(OBJDIR)/hashutil.o \
$(OBJDIR)/partitioned_counter.o
gqf_verify: $(OBJDIR)/gqf_verify.o $(OBJDIR)/gqf.o \
$(OBJDIR)/hashutil.o \
$(OBJDIR)/partitioned_counter.o
test: $(OBJDIR)/test.o $(OBJDIR)/gqf.o \
$(OBJDIR)/hashutil.o \
$(OBJDIR)/partitioned_counter.o \
$(OBJDIR)/RSQF.o \
$(OBJDIR)/sqf.o \
# dependencies between .o files and .h files
$(OBJDIR)/cluster_length_test.o: $(LOC_INCLUDE)/gqf.cuh \
$(LOC_INCLUDE)/hashutil.cuh \
$(LOC_INCLUDE)/partitioned_counter.cuh
$(OBJDIR)/gqf_verify.o: $(LOC_INCLUDE)/gqf.cuh \
$(LOC_INCLUDE)/hashutil.cuh \
$(LOC_INCLUDE)/partitioned_counter.cuh
$(OBJDIR)/test.o: $(LOC_INCLUDE)/gqf_wrapper.cuh \
$(LOC_INCLUDE)/partitioned_counter.cuh \
$(LOC_INCLUDE)/cu_wrapper.cuh \
$(LOC_INCLUDE)/RSQF.cuh \
$(LOC_INCLUDE)/sqf.cuh \
# dependencies between .o files and .cc (or .c) files
$(OBJDIR)/RSQF.o: $(LOC_SRC)/RSQF.cu $(LOC_INCLUDE)/RSQF.cuh
$(OBJDIR)/gqf.o: $(LOC_SRC)/gqf.cu $(LOC_INCLUDE)/gqf.cuh
$(OBJDIR)/hashutil.o: $(LOC_SRC)/hashutil.cu $(LOC_INCLUDE)/hashutil.cuh
$(OBJDIR)/partitioned_counter.o: $(LOC_INCLUDE)/partitioned_counter.cuh
$(OBJDIR)/sqf.o: $(LOC_SRC)/sqf.cu $(LOC_INCLUDE)/sqf.cuh
#
# generic build rules
#
$(TARGETS):
$(LD) $^ -o $@ $(LDFLAGS)
$(OBJDIR)/sqf.o: $(LOC_SRC)/sqf.cu | $(OBJDIR)
$(CU) $(CUFLAGS) $(INCLUDE) --extended-lambda -dc $< -o $@
$(OBJDIR)/%.o: $(LOC_SRC)/%.cu | $(OBJDIR)
$(CU) $(CUFLAGS) $(INCLUDE) -dc $< -o $@
$(OBJDIR)/%.o: $(LOC_SRC)/%.cc | $(OBJDIR)
$(CXX) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
$(OBJDIR)/%.o: $(LOC_SRC)/%.c | $(OBJDIR)
$(CC) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
$(OBJDIR)/%.o: $(LOC_TEST)/%.c | $(OBJDIR)
$(CC) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
$(OBJDIR):
@mkdir -p $(OBJDIR)
clean:
rm -rf $(OBJDIR) $(TARGETS) core