forked from ParAlg/gbbs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile.variables
95 lines (87 loc) · 1.72 KB
/
makefile.variables
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
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
OS := linux
else ifeq ($(UNAME), Darwin)
OS := mac
endif
ifeq (, $(shell which jemalloc-config))
JEMALLOC =
else
JEMALLOCLD = $(shell jemalloc-config --libdir)
JEMALLOC = -L$(JEMALLOCLD) -ljemalloc
endif
# Always compile with LONG (note that timings on small graphs may be a bit
# faster w/o this flag).
INTT = -DLONG
ifdef EDGELONG
INTE = -DEDGELONG
endif
OPT = -O3 -DNDEBUG
#OPT = -O3 -g
#OPT = -O0 -g
CFLAGS = \
-U_FORTIFY_SOURCE \
'-D__DATE__="redacted"' \
'-D__TIMESTAMP__="redacted"' \
'-D__TIME__="redacted"' \
-fno-omit-frame-pointer \
-fstack-protector \
-fPIC \
-Wall \
-Wextra \
-Wcast-qual \
-Wno-builtin-macro-redefined \
-Wno-unused-parameter \
-Wpointer-arith \
-Wvla \
-std=c++17 \
-march=native \
-mcx16 \
$(OPT) \
$(INTT) \
$(INTE) \
$(CONCEPTS) \
-DAMORTIZEDPD \
-DUSEMALLOC
# Add GCC-specific and Clang-specific flags
ifeq ($(OS), linux)
CFLAGS += \
-Wno-free-nonheap-object \
-Wunused-but-set-parameter
else ifeq ($(OS), mac)
CFLAGS += \
-Wself-assign \
-Wthread-safety
endif
OMPFLAGS = -DOPENMP -fopenmp
CILKFLAGS = -DCILK -fcilkplus
HGFLAGS = -DHOMEGROWN -pthread
ifdef CLANG
CC = clang++
PFLAGS = $(CILKFLAGS)
else ifdef CILK
CC = g++
PFLAGS = $(CILKFLAGS)
LFLAGS = -lcilkrts
else ifdef OPENMP
CC = g++
PFLAGS = $(OMPFLAGS)
LFLAGS = -fopenmp
else ifdef HOMEGROWN
CC = g++
PFLAGS = $(HGFLAGS)
else ifdef SERIAL
CC = g++
PFLAGS =
else # default is homegrown
CC = g++
PFLAGS = $(HGFLAGS)
endif
ifeq ($(OS), linux)
LINKER_START_GROUP := -Wl,--start-group
LINKER_END_GROUP := -Wl,--end-group
else ifeq ($(OS), mac)
# macOS's default linker doesn't use the --start-group and --end-group flags.
LINKER_START_GROUP :=
LINKER_END_GROUP :=
endif