forked from exafmm/exafmm-beta
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.am.include
164 lines (147 loc) · 3.15 KB
/
Makefile.am.include
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
### Base flags
AM_CPPFLAGS = -I../include
#AM_CPPFLAGS += -DSEND_MULTIPOLES
if EXAFMM_HAVE_BG
AM_CXXFLAGS = -qarch=qp -qtune=qp -O3 -qhot
AM_FCFLAGS = -qarch=qp -qtune=qp -O3 -qhot
else
if EXAFMM_HAVE_FX
AM_CXXFLAGS = -Kfast,openmp
AM_FCFLAGS = -Kfast,openmp -f w
else
if EXAFMM_HAVE_SX
AM_CXXFLAGS = -Caopt -Nacct -O nomsg -pi nomsg -pvctl nomsg
AM_FCFLAGS = -Caopt -Nacct -O nomsg -pi nomsg -pvctl nomsg
else
if EXAFMM_HAVE_CRAY
AM_CXXFLAGS = -dynamic
AM_FCFLAGS = -dynamic
if EXAFMM_HAVE_GNU
AM_CXXFLAGS += -ffast-math -funroll-loops -fabi-version=6
AM_FCFLAGS += -ffast-math -funroll-loops
endif
if EXAFMM_HAVE_INTEL
AM_CXXFLAGS += -ansi_alias -fabi-version=6
AM_FCFLAGS += -ansi_alias
endif
else
if EXAFMM_HAVE_INTEL
AM_CXXFLAGS = -ansi_alias -fabi-version=6
AM_FCFLAGS = -ansi_alias
else
if EXAFMM_HAVE_CLANG
AM_CXXFLAGS = -ffast-math -funroll-loops
AM_FCFLAGS = -ffast-math -funroll-loops
else
if EXAFMM_HAVE_GNU
AM_CXXFLAGS = -ffast-math -funroll-loops -fabi-version=6
AM_FCFLAGS = -ffast-math -funroll-loops
else
AM_CXXFLAGS =
AM_FCFLAGS =
endif
endif
endif
endif
endif
endif
endif
### Thread libraries
if EXAFMM_HAVE_OPENMP
AM_CPPFLAGS += -DEXAFMM_WITH_OPENMP
AM_CXXFLAGS += $(OPENMP_CXXFLAGS)
AM_FCFLAGS += $(OPENMP_FCFLAGS)
endif
if EXAFMM_WITH_TBB
LIBS += -ltbb
endif
if EXAFMM_WITH_CILK
LIBS += -lcilkrts
endif
if EXAFMM_WITH_MTHREAD
LIBS += -lmyth-native
endif
if EXAFMM_WITH_QTHREAD
LIBS += -lqthread
endif
### Floating point precision
if EXAFMM_SINGLE
AM_CPPFLAGS += -DEXAFMM_SINGLE
endif
### SIMD flags
if EXAFMM_USE_SIMD
AM_CPPFLAGS += -DEXAFMM_USE_SIMD
if EXAFMM_HAVE_MIC
AM_CXXFLAGS += $(MIC_CXXFLAGS) # Use MIC intrinsics
else
if EXAFMM_HAVE_AVX
AM_CXXFLAGS += $(AVX_CXXFLAGS) # Use AVX intrinsics
else
if EXAFMM_HAVE_SSE3
AM_CXXFLAGS += $(SSE3_CXXFLAGS) # Use SSE3 intrinsics
else
if EXAFMM_HAVE_NEON
AM_CXXFLAGS += $(NEON_CXXFLAGS) # Use Neon intrinsics
endif
endif
endif
endif
endif
# OpenMPI needs an extra library when linking with Fortran
if EXAFMM_HAVE_MPI
LIBS += $(OPENMPILIBS)
endif
# Kahan summation
if EXAFMM_USE_KAHAN
AM_CPPFLAGS += -DEXAFMM_USE_KAHAN
endif
# Use weights for partitioning
if EXAFMM_USE_WEIGHT
AM_CPPFLAGS += -DEXAFMM_USE_WEIGHT
endif
# Use PAPI performance counter (export EXAFMM_PAPI_EVENTS="PAPI_L2_DCM,PAPI_L2_DCA,PAPI_TLB_DM")
if EXAFMM_USE_PAPI
AM_CPPFLAGS += -DEXAFMM_USE_PAPI
LIBS += -lpapi
endif
# Use thread tracing
if EXAFMM_USE_TRACE
AM_CPPFLAGS += -DEXAFMM_USE_TRACE
endif
# Use DAG Recorder
if EXAFMM_USE_DAG
AM_CPPFLAGS += -DDAG_RECORDER=2
LIBS += -ldr
endif
# Count number of M2L and P2P kernel calls
if EXAFMM_COUNT_KERNEL
AM_CPPFLAGS += -DEXAFMM_COUNT_KERNEL
endif
# Count interaction list per cell
if EXAFMM_COUNT_LIST
AM_CPPFLAGS += -DEXAFMM_COUNT_LIST
endif
if EXAFMM_ASSERT
AM_CPPFLAGS += -DNDEBUG
endif
if EXAFMM_DEBUG
#AM_CXXFLAGS += -fsanitize=address -Wconversion -Wundef
AM_CXXFLAGS += -ftrapv -O0 -Wall -Wextra -Winit-self -Wshadow -Wuninitialized -Wunreachable-code
endif
AM_MAKEFLAGS = -s
help:
@make -C .. help
buildbot:
@make -C .. buildbot
cleanbin:
@make -C .. cleanbin
cleandat:
@make -C .. cleandat
cleanlib:
@make -C .. cleanlib
cleanall:
@make -C .. cleanall
revert:
@make -C .. revert
save:
@make -C .. save