forked from pwittich/mictest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.config
193 lines (152 loc) · 5.61 KB
/
Makefile.config
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
################################################################
# Build notes
################################################################
# Requires a recent gcc, e.g.:
# . /opt/rh/devtoolset-2/enable
# This is also needed for icc as it uses gcc headers.
# To build mkFit -- Matriplex Kalman Fit:
# - enable USE_MATRIPEX in section 5,
# - cd mkFit; make (or make -C mkFit).
################################################################
# Configuration section
################################################################
# 1. Use ROOT or not (never used on MIC)
# Comment out to disable root ("yes" is not relevant)
#WITH_ROOT := yes
# 2. Use gcc (clang by default on mac) or icc
# Comment out to force using standard c++. For mic only icc can be used.
ifdef INTEL_LICENSE_FILE
CXX := icc
endif
# 2.1 Use nvcc to compile cuda code
# CUDA compiler
NV := nvcc
# Comment out to compile for CPU
# USE_CUDA := -DUSE_CUDA
# 3. Optimization
# -O3 implies vectorization and simd (but not AVX)
OPT := -O3 -g
# 4. Vectorization settings
VEC_GCC := # -mavx # -fopt-info-vec
VEC_ICC := -mavx
VEC_MIC := -mmic
# 5. Matriplex, intrinsics, vtune
# Matriplex is required for build in mkFit/
# Comment-out for matriplex, intrinsics (supported for MIC and AVX)
USE_MATRIPLEX := -DUSE_MATRIPLEX
#USE_INTRINSICS := -DMPLEX_USE_INTRINSICS
# To enforce given vector size (does not work with intrinsics!)
# USE_INTRINSICS := -DMPT_SIZE=1
USE_VTUNE_NOTIFY := yes
# 6. MIC stuff is built when icc is the chosen compiler.
# MIC build is always done without root.
# Need to build root on MIC and figure out how to deploy it there.
# 7. OSX hack (is there a good way to detect clang?)
# MT needs this on OSX-10.8, c++ -v
# Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
# OSX_CXXFLAGS := -stdlib=libc++
# And with gcc-4.8.1 from cms we need this
# OSX_LDFLAGS := -lstdc++
#
# Note: there is a problem building with USE_MATRIPLEX on as there
# was no __builtin_assume_aligned support in clang until recently:
# http://reviews.llvm.org/rL217349
# It will probably take a while before this gets to osx / xcode.
# If somebody is willing to test this we can try without this
# but it was giving 50% speedup on icc.
# 8. Use USolids Geometry (turn off for a trivial cylinder)
#WITH_USOLIDS := yes
# 9. Check track state propagation for success, turns on simple
# checks of filter convergence
USE_STATE_VALIDITY_CHECKS := -DCHECKSTATEVALID
# 10. Turn on multiple scattering
#USE_SCATTERING := -DSCATTERING
# 11. In track building, use linear interpolation across a
# a volume instead of using the geometry
USE_LINEAR_INTERPOLATION := -DLINEARINTERP
# 12. Use built tracks for fitting, comment out to fit sim tracks
ENDTOEND := -DENDTOEND
# 13. Intel Threading Building Blocks. With icc uses system
# TBB, otherwise requires a local installation, and paths will
# have to be adjusted.
#WITH_TBB := yes
# 14. Use for eta-phi segmentation
USE_ETA_SEGMENTATION := -DETASEG
# 15. Generate flat in eta (originally just flat in pz)
GEN_FLAT_ETA := -DGENFLATETA
# 16. Use inward fit in Conformal fit + final KF Fit
INWARD_FIT := -DINWARDFIT
# 17. Super debug mode --> allows really deep exploration of all props/updates etc with single track events, no skipping, in SMatrix, "yes" is irrevelant
#SUPER_DEBUG := yes
################################################################
# Derived settings
################################################################
CPPFLAGS := -I. ${USE_MATRIPLEX} ${USE_INTRINSICS} ${USE_CUDA} -std=c++11
CXXFLAGS := ${OPT} ${OSX_CXXFLAGS}
LDFLAGS_HOST :=
LDFLAGS_MIC :=
CPPFLAGS += ${USE_STATE_VALIDITY_CHECKS} ${USE_SCATTERING} ${USE_LINEAR_INTERPOLATION} ${ENDTOEND} ${USE_ETA_SEGMENTATION} ${INWARD_FIT} ${GEN_FLAT_ETA}
ifdef USE_VTUNE_NOTIFY
ifdef VTUNE_AMPLIFIER_XE_2016_DIR
CPPFLAGS += -I$(VTUNE_AMPLIFIER_XE_2016_DIR)/include -DUSE_VTUNE_PAUSE
LDFLAGS_HOST += -L$(VTUNE_AMPLIFIER_XE_2016_DIR)/lib64 -littnotify
LDFLAGS_MIC += -L$(VTUNE_AMPLIFIER_XE_2016_DIR)/bin64/k1om -littnotify
endif
endif
ifneq ($(CXX),icc)
#CXXFLAGS += -Wall -Wno-unknown-pragmas
endif
ifeq ($(CXX),icc)
VEC_HOST := ${VEC_ICC}
CXXFLAGS += -qopt-report
else
VEC_HOST := ${VEC_GCC}
endif
ifdef USE_MATRIPLEX
ifeq ($(CXX),icc)
CXXFLAGS += -openmp
LDFLAGS += -openmp
else
CXXFLAGS += -fopenmp
LDFLAGS += -fopenmp
endif
endif
ifdef WITH_USOLIDS
CPPFLAGS += -DWITH_USOLIDS
LIBUSOLIDS := USolids-host/libusolids.a
LIBUSOLIDS_MIC := USolids-mic/libusolids.a
CMAKEFLAGS := -DCMAKE_CXX_COMPILER:STRING=${CXX} -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} ${VEC_HOST}"
CMAKEFLAGS_MIC := -DCMAKE_CXX_COMPILER:STRING=${CXX} -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} ${VEC_MIC}"
endif
ifdef WITH_TBB
ifneq ($(CXX),icc)
CPPFLAGS += -Itbb/include
LDFLAGS += -Ltbb/lib -rpath tbb/lib
endif
CPPFLAGS += -DTBB
LDFLAGS += -ltbb
endif
CPPFLAGS_NO_ROOT := ${CPPFLAGS} -DNO_ROOT
LDFLAGS_NO_ROOT := ${LDFLAGS}
ifdef WITH_ROOT
CPPFLAGS += $(shell root-config --cflags)
LDFLAGS += $(shell root-config --libs)
else
CPPFLAGS += -DNO_ROOT
endif
ifdef SUPER_DEBUG
CPPFLAGS := -I. -DCHECKSTATEVALID -DLINEARINTERP -DETASEG -DINWARDFIT -DGENFLATETA $(shell root-config --cflags)
CXXFLAGS := -O3 -g
LDFLAGS := $(shell root-config --libs)
endif
################################################################
# Dependency generation
################################################################
DEPEND_TGTS = -MQ '$(patsubst %.d,%.o,$@)'
ifeq (${CXX},icc)
DEPEND_TGTS += -MQ '$(patsubst %.d,%.om,$@)'
endif
# Always use gcc as icc used to have trouble with this (? check if still true)
MAKEDEPEND = gcc -MM -MG ${DEPEND_TGTS} ${CPPFLAGS}
%.d: %.cc
${MAKEDEPEND} -o $@ $<