forked from lattice/quda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
439 lines (351 loc) · 11.3 KB
/
configure.ac
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
AC_INIT([quda],[0.4],[[email protected]])
AC_PROG_CC(gcc cc)
AC_PROG_CXX(g++ CC cxx)
AC_CHECK_HEADER([numa.h])
dnl Specify CUDA Location
AC_ARG_WITH(cuda,
AC_HELP_STRING([--with-cuda=CUDADIR], [ Specify CUDA installation directory ]),
[ cuda_home=${withval} ],
[ cuda_home=/usr/local/cuda ]
)
dnl Specify CPU Arch
AC_ARG_ENABLE(cpu-arch,
AC_HELP_STRING([--enable-cpu-arch=arch], [ Set CPU arch: x86 or x86_64 (default: x86_64)] ),
[ cpu_arch=${enableval} ],
[ cpu_arch="x86_64" ]
)
dnl Specify GPU Arch
AC_ARG_ENABLE(gpu-arch,
AC_HELP_STRING([--enable-gpu-arch=arch], [ Set GPU arch=sm_10, sm_12,sm_13,sm_20, sm_21 (default: sm_20)] ),
[ gpu_arch=${enableval} ],
[ gpu_arch="sm_20" ]
)
dnl Enable GPU Emulation (CUDA 3.0 only)
AC_ARG_ENABLE(gpu-emulation,
AC_HELP_STRING([--enable-gpu-emulation], [ Enable GPU emulation (CUDA v3.0). (default is 'no' )]),
[ gpu_emu=${enableval} ],
[ gpu_emu="no" ]
)
AC_ARG_ENABLE(os,
AC_HELP_STRING([--enable-os=os], [ Set OS Build style: linux, osx (default is linux)]),
[ quda_os=${enableval} ],
[ quda_os="linux" ]
)
AC_ARG_WITH(python,
AC_HELP_STRING([--with-python=path ], [ Set Python to use for make gen]),
[ quda_python=${withval} ],
[ quda_python="python" ]
)
AC_ARG_ENABLE(tune-device,
AC_HELP_STRING([--enable-tune-device=device], [ Set Device to use for make tune ]),
[ tune_device=${enableval} ],
[ tune_device=0 ]
)
AC_ARG_ENABLE(host-debug,
AC_HELP_STRING([--enable-host-debug], [ Enable debugging of host code ]),
[ quda_host_debug=${enableval} ],
[ quda_host_debug="no" ]
)
AC_ARG_ENABLE(device-debug,
AC_HELP_STRING([--enable-device-debug], [ Enable debugging for device code]),
[ quda_device_debug=${enableval} ],
[ quda_device_debug="no" ]
)
AC_ARG_ENABLE(verbose-build,
AC_HELP_STRING([--enable-verbose-build], [ Display Kernel Register Usage ]),
[ quda_verbose_build=${enableval} ],
[ quda_verbose_build="no" ]
)
AC_ARG_ENABLE(dslash-profiling,
AC_HELP_STRING([--enable-dslash-profiling], [ Enable profiling of multi-GPU dslash ]),
[ quda_dslash_profiling=${enableval} ],
[ quda_dslash_profiling="no" ]
)
AC_ARG_ENABLE(wilson-dirac,
AC_HELP_STRING([--enable-wilson-dirac], [ Build Wilson Dirac Op (default=enabled) ]),
[ build_wilson_dirac=${enableval} ],
[ build_wilson_dirac="yes" ]
)
AC_ARG_ENABLE(clover-dirac,
AC_HELP_STRING([--enable-clover-dirac], [ Build Clover Dirac Op (default=enabled) ]),
[ build_clover_dirac=${enableval} ],
[ build_clover_dirac="yes" ]
)
AC_ARG_ENABLE(domain-wall-dirac,
AC_HELP_STRING([--enable-domain-wall-dirac], [ Build Domain Wall Dirac Op (default=enabled) ]),
[ build_dwf_dirac=${enableval} ],
[ build_dwf_dirac="yes" ]
)
AC_ARG_ENABLE(staggered-dirac,
AC_HELP_STRING([--enable-staggered-dirac], [ Build Staggered Dirac Op (default=enabled) ]),
[ build_staggered_dirac=${enableval} ],
[ build_staggered_dirac="yes" ]
)
AC_ARG_ENABLE(twisted-mass-dirac,
AC_HELP_STRING([--enable-twisted-mass-dirac], [ Build Twisted Mass Dirac Op (default=enabled) ]),
[ build_twm_dirac=${enableval} ],
[ build_twm_dirac="yes" ]
)
AC_ARG_ENABLE(staggered-fatlink,
AC_HELP_STRING([--enable-staggered-fatlink], [ Build Staggered Fat Link Code (default=disabled) ]),
[ build_staggered_fatlink=${enableval} ],
[ build_staggered_fatlink="no" ]
)
AC_ARG_ENABLE(gauge-force,
AC_HELP_STRING([--enable-gauge-force], [ Build 1 loop Symanzik gauge force (default=disabled) ]),
[ build_gauge_force=${enableval} ],
[ build_gauge_force="no" ]
)
AC_ARG_ENABLE(staggered-force,
AC_HELP_STRING([--enable-staggered-force], [ Build Staggered Force Term (default=disabled) ]),
[ build_staggered_force=${enableval} ],
[ build_staggered_force="no" ]
)
dnl Multi-GPU options
dnl ==================
dnl enable multi-gpu mode
AC_ARG_ENABLE(multi-gpu,
AC_HELP_STRING([--enable-multi-gpu], [ Enable Multi-GPU mode (default is no)]),
[ multi_gpu=${enableval} ],
[ multi_gpu="no" ]
)
dnl enable comms compute/overlap
AC_ARG_ENABLE(overlap-comms,
AC_HELP_STRING([--enable-overlap-comms], [ Enable comms/compute overlap (default is yes)]),
[ overlap_comms=${enableval}],
[ overlap_comms="yes" ]
)
AC_ARG_WITH(mpi,
AC_HELP_STRING([--with-mpi= MPIDIR], [ Specify installation directory for MPI ]),
[ mpi_home=${withval}; build_mpi="yes" ],
[ mpi_home=""; build_mpi="no" ]
)
AC_ARG_WITH(qmp,
AC_HELP_STRING([--with-qmp=QMPDIR], [ Specify QMP installation directory ]),
[ qmp_home=${withval} ; build_qmp="yes" ],
[ qmp_home="" ; build_qmp="no" ]
)
AC_ARG_WITH(qio,
AC_HELP_STRING([--with-qio=QIODIR], [ Specify QIO installation directory ]),
[ qio_home=${withval} ; build_qio="yes" ],
[ qio_home="" ; build_qio="no" ]
)
dnl Input validation
dnl CPU Arch
case ${cpu_arch} in
x86 | x86_64 ) ;;
*)
AC_MSG_ERROR([ cpu arch must be either x86_64 or x86 ])
;;
esac
dnl CPU Arch
case ${gpu_arch} in
sm_10 | sm_11 | sm_12 | sm_13 | sm_20 | sm_21 ) ;;
*)
AC_MSG_ERROR([ cpu arch must be either x86_64 or x86 ])
;;
esac
dnl OS
case ${quda_os} in
linux|osx);;
*)
AC_MSG_ERROR([ --enable-os only supports 'linux' and 'osx' ])
;;
esac
dnl HOST DEBUG
case ${quda_host_debug} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-host-debug ])
;;
esac
dnl DEVICE DEBUG
case ${quda_device_debug} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-device-debug ])
;;
esac
dnl VERBOSE
case ${quda_verbose_build} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-quda-verbose-build ])
;;
esac
dnl DSLASH_PROFILING
case ${quda_dslash_profiling} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-dslash-profiling ])
;;
esac
dnl Build Wilson Dirac
case ${build_wilson_dirac} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-wilson-dirac : ${build_wilson_dirac} ])
;;
esac
dnl Build Clover Dirac
case ${build_clover_dirac} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-clover-dirac : ${build_clover_dirac} ])
;;
esac
dnl Build DWF Dirac
case ${build_dwf_dirac} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-domain-wall-dirac ])
;;
esac
dnl Build Staggered Dirac
case ${build_staggered_dirac} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-staggered-dirac ])
;;
esac
dnl Build Twisted Mass Dirac
case ${build_twm_dirac} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-twisted-mass-dirac ])
;;
esac
dnl Build Staggered fatlink
case ${build_staggered_fatlink} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-staggered-fatlink ])
;;
esac
dnl Build Gauge Force
case ${build_gauge_force} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-gauge-force ])
;;
esac
dnl Build Staggered force
case ${build_staggered_force} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-staggered-force ])
;;
esac
dnl Multi GPU
case ${multi_gpu} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-multi-gpu ])
;;
esac
dnl Build Staggered force
case ${overlap_comms} in
yes|no);;
*)
AC_MSG_ERROR([ invalid value for --enable-overlap-comms ])
;;
esac
dnl Configuration phase
dnl ===================
dnl
dnl Currently DWF doesnt support parallelism -- that needs a different structure
dnl so if Multi-GPU is turned on I should disable this
dnl QMP/MPI: It is legal to have both --with-qmp and --with-mpi
dnl defined together. This means that: Use QMP with the MPI in MPIHOME.
dnl but we have to disable mpi_comms
if test "X${build_qmp}X" = "XyesX";
then
build_mpi="no"
fi
if test "X${multi_gpu}X" = "XyesX";
then
AC_MSG_NOTICE([Enabling Multi-GPU])
AC_MSG_NOTICE([Multi-GPU doesnt support Domain-Wall Dirac Op yet: disabling ])
build_dwf_dirac="no";
AC_MSG_NOTICE([Multi-GPU doesnt support Gauge Force yet: disabling ])
build_gauge_force="no"
AC_MSG_NOTICE([Multi-GPU doesnt support Staggered Force yet:disabling ])
build_staggered_force="no"
if test "X${qmp_home}X" = "XX";
then
dnl qmp_home is empty
AC_MSG_WARN([ Multi-GPU build without QMP. Will build single node code with copies ])
else
dnl qmp home is not empty
if test "X${mpi_home}X" = "XX";
then
AC_MSG_WARN([ It looks like QMP is being used, but --with-mpi is NOT set... BEWARE ])
fi
fi
fi
if test "X${build_qio}X" = "XyesX"; then
if test "X${build_qmp}X" = "XnoX"; then
AC_MSG_ERROR([QMP must enabled for QIO support ])
fi
fi
dnl Output Substitutions
AC_MSG_NOTICE([Setting CUDA_INSTALL_PATH = ${cuda_home} ])
AC_SUBST( CUDA_INSTALL_PATH, [${cuda_home} ])
AC_MSG_NOTICE([Setting CPU_ARCH = ${cpu_arch} ])
AC_SUBST( CPU_ARCH, [${cpu_arch}] )
AC_MSG_NOTICE([Setting GPU_ARCH = ${gpu_arch} ])
AC_SUBST( GPU_ARCH, [${gpu_arch}] )
AC_MSG_NOTICE([Setting OS = ${quda_os} ])
AC_SUBST( QUDA_OS, [${quda_os}] )
AC_MSG_NOTICE([Setting QUDA_PYTHON = ${quda_python} ])
AC_SUBST( QUDA_PYTHON, [${quda_python}] )
AC_MSG_NOTICE([Setting DEVICE = ${tune_device} ])
AC_SUBST( DEVICE,[${tune_device}] )
AC_MSG_NOTICE([Setting HOST_DEBUG = ${quda_host_debug} ])
AC_SUBST( HOST_DEBUG, [${quda_host_debug}] )
AC_MSG_NOTICE([Setting DEVICE_DEBUG = ${quda_device_debug} ])
AC_SUBST( DEVICE_DEBUG, [${quda_device_debug}] )
AC_MSG_NOTICE([Setting VERBOSE = ${quda_verbose_build} ])
AC_SUBST( VERBOSE, [${quda_verbose_build}] )
AC_MSG_NOTICE([Setting DSLASH_PROFILING = ${quda_dslash_profiling} ])
AC_SUBST( DSLASH_PROFILING, [${quda_dslash_profiling}] )
AC_MSG_NOTICE([Setting BUILD_WILSON_DIRAC = ${build_wilson_dirac} ])
AC_SUBST( BUILD_WILSON_DIRAC, [${build_wilson_dirac}])
AC_MSG_NOTICE([Setting BUILD_CLOVER_DIRAC = ${build_clover_dirac} ])
AC_SUBST( BUILD_CLOVER_DIRAC, [${build_clover_dirac}])
AC_MSG_NOTICE([Setting BUILD_DOMAIN_WALL_DIRAC = ${build_dwf_dirac} ])
AC_SUBST( BUILD_DOMAIN_WALL_DIRAC, [${build_dwf_dirac}])
AC_MSG_NOTICE([Setting BUILD_STAGGERED_DIRAC = ${build_staggered_dirac} ])
AC_SUBST( BUILD_STAGGERED_DIRAC, [${build_staggered_dirac}])
AC_MSG_NOTICE([Setting BUILD_TWISTED_MASS_DIRAC = ${build_twm_dirac} ])
AC_SUBST( BUILD_TWISTED_MASS_DIRAC, [${build_twm_dirac}])
AC_MSG_NOTICE([Setting BUILD_FATLINK = ${build_staggered_fatlink} ] )
AC_SUBST( BUILD_FATLINK, [${build_staggered_fatlink}])
AC_MSG_NOTICE([Setting BUILD_GAUGE_FORCE = ${build_gauge_force} ] )
AC_SUBST( BUILD_GAUGE_FORCE, [${build_gauge_force}])
AC_MSG_NOTICE([Setting BUILD_FERMION_FORCE = ${build_staggered_force} ] )
AC_SUBST( BUILD_FERMION_FORCE, [${build_staggered_force}])
AC_MSG_NOTICE([Setting BUILD_MULTI_GPU = ${multi_gpu} ] )
AC_SUBST( BUILD_MULTI_GPU, [${multi_gpu}])
AC_MSG_NOTICE([Setting BUILD_QMP = ${build_qmp} ])
AC_SUBST( BUILD_QMP, [${build_qmp}])
AC_MSG_NOTICE([Setting BUILD_MPI = ${build_mpi} ])
AC_SUBST( BUILD_MPI, [${build_mpi}])
AC_MSG_NOTICE([Setting OVERLAP_COMMS= ${overlap_comms}])
AC_SUBST( OVERLAP_COMMS, [${overlap_comms}])
AC_MSG_NOTICE([Setting BUILD_QIO = ${build_qio} ])
AC_SUBST( BUILD_QIO, [${build_qio}])
AC_MSG_NOTICE([Setting FECC = ${CC} ])
AC_SUBST( FECC, [${CC}])
AC_MSG_NOTICE([Setting FECXX = ${CXX} ])
AC_SUBST( FECXX, [${CXX}])
AC_MSG_NOTICE([Setting MPI_HOME=${mpi_home}])
AC_SUBST( MPI_HOME, [${mpi_home}] )
AC_MSG_NOTICE([Setting QMP_HOME=${qmp_home}])
AC_SUBST( QMP_HOME, [${qmp_home}] )
AC_MSG_NOTICE([Setting QIO_HOME=${qio_home}])
AC_SUBST( QIO_HOME, [${qio_home}] )
AC_MSG_NOTICE([Setting HAVE_NUMA=${ac_cv_header_numa_h}])
AC_SUBST( HAVE_NUMA, [${ac_cv_header_numa_h}] )
AC_CONFIG_FILES(make.inc)
AC_OUTPUT