-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfigure.ac
More file actions
686 lines (583 loc) · 25 KB
/
configure.ac
File metadata and controls
686 lines (583 loc) · 25 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
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
AC_INIT([DLB],
m4_esyscmd([scripts/git-version-gen .tarball-version]),
[dlb@bsc.es],
[dlb],
[https://pm.bsc.es/dlb])
AC_CONFIG_SRCDIR([src/LB_core/DLB_kernel.c])
# Save configure arguments, ignore the ones we are not interested in
dlb_config_args="$0"
for arg in ${1+"$@"}; do
case $arg in
--no-create) ;;
--no-recursion) ;;
--*able-developer-mode) ;;
--*able-extra-warnings) ;;
*) AS_VAR_APPEND([dlb_config_args], [" $arg"])
esac
done
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
AC_CONFIG_MACRO_DIR([m4])
# Enable silent rules if available
supported_silent_rules=1
m4_ifdef([AM_SILENT_RULES],
[AM_SILENT_RULES([yes])],
[supported_silent_rules=0])
AM_CONDITIONAL([SUPPORTED_SILENT_RULES], test x$supported_silent_rules = x1)
################################################################################
# Obtain versioning information
################################################################################
AC_ARG_VAR([GIT], [distributed version control system])
AC_PATH_PROG([GIT], [git], [])
build_from_git=no
dlb_git_branch=""
dlb_version_string="$PACKAGE $VERSION"
AS_IF([test -e "$srcdir/.git"], [
AC_MSG_CHECKING([revision of git repository])
AS_IF([test x"$GIT" != x], [
dlb_git_branch=`"$GIT" --git-dir=$srcdir/.git rev-parse --abbrev-ref HEAD`
dlb_git_describe=`"$GIT" --git-dir=$srcdir/.git describe HEAD`
dlb_version_string="$PACKAGE $VERSION ($dlb_git_branch)"
AC_MSG_RESULT([$dlb_git_describe ($dlb_git_branch)])
build_from_git=yes
], [
AC_MSG_RESULT([unknown])
])
], [test -e $srcdir/.tarball-version], [
AC_MSG_CHECKING([revision of distributed release])
AC_MSG_RESULT([$VERSION])
])
AC_DEFINE_UNQUOTED([DLB_VERSION_STRING], ["$dlb_version_string"], [dlb version string, and possibly branch])
# We need Python for the version parser
AM_PATH_PYTHON
# Major, minor, and patch numbers go to config.h
DLB_VERSION_MAJOR=$($PYTHON "$srcdir/scripts/parse_version.py" major $VERSION)
AC_DEFINE_UNQUOTED([DLB_VERSION_MAJOR], [$DLB_VERSION_MAJOR], [dlb major version])
DLB_VERSION_MINOR=$($PYTHON "$srcdir/scripts/parse_version.py" minor $VERSION)
AC_DEFINE_UNQUOTED([DLB_VERSION_MINOR], [$DLB_VERSION_MINOR], [dlb minor version])
DLB_VERSION_PATCH=$($PYTHON "$srcdir/scripts/parse_version.py" patch $VERSION)
AC_DEFINE_UNQUOTED([DLB_VERSION_PATCH], [$DLB_VERSION_PATCH], [dlb patch version])
# Version hexadecimal number go to dlb.h
DLB_VERSION_HEXA=$($PYTHON "$srcdir/scripts/parse_version.py" hexa $VERSION)
AC_SUBST([DLB_VERSION_HEXA])
# branch is needed for internal CI pipelines
DLB_GIT_BRANCH="$dlb_git_branch"
AC_SUBST([DLB_GIT_BRANCH])
# DEPRECATED --enable-developer-mode in favor of --enable-extra-warnings
AC_ARG_ENABLE([developer-mode],
AS_HELP_STRING([--enable-developer-mode],
[(deprecated: use --enable-extra-warnings instead)
use stricter error compilation flags]),
[], dnl Implicit: enable_developer_mode=$enableval
[enable_developer_mode=no]
)
AC_MSG_CHECKING([whether to enable extra warnings])
AC_ARG_ENABLE([extra-warnings],
AS_HELP_STRING([--enable-extra-warnings],
[enable -Wall, -Werror, and other extra warning flags
(enabled by default if project is a git repository, disabled otherwise)]),
[], dnl Implicit: enable_extra_warnings=$enableval
[enable_extra_warnings=$build_from_git]
)
# keep compatibility until removal
AS_IF([test x"$enable_developer_mode" = xyes && test x"$enable_extra_warnings" = xno], [
enable_extra_warnings=yes
])
AC_MSG_RESULT([$enable_extra_warnings])
AC_DEFINE_UNQUOTED([DLB_CONFIGURE_ARGS], ["$dlb_config_args"], [Configure options])
# Debian release
AC_CHECK_PROG([DEB_RELEASE], [lsb_release], [$(lsb_release -sc)], [])
AC_SUBST([DEB_RELEASE])
################################################################################
# Configure compiler and compiler flags
################################################################################
# If CFLAGS / FCFLAGS are not user-defined, define then as empty to avoid
# AC_PROG_CC and AC_PROG_FC setting then to the default value '-g -O2'
: ${CFLAGS=""}
: ${FCFLAGS=""}
# Checks for programs
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
AM_CONDITIONAL([HAVE_STATIC_LIBS], [test "x$enable_static" = xyes])
AC_PROG_CPP
##### C Compiler checks #####
AC_PROG_CC([$CC])
AM_PROG_CC_C_O
dnl Autoconf 2.69 and below need this macro to check for C99
dnl In newer versions the macro is deprecated
m4_version_prereq([2.70], [:], [AC_PROG_CC_C99])
# use the C compiler for the following checks
AC_LANG([C])
# Add minimum c99 standard
# if ac_cv_prog_cc_c{11,99} is set and its value is not 'no', no-op
AS_IF([${ac_cv_prog_cc_c11+:} false && test x"$ac_cv_prog_cc_c11" != xno], [:],
[${ac_cv_prog_cc_c99+:} false && test x"$ac_cv_prog_cc_c99" != xno], [:],
# if ac_cv_prog_cc_c89 is set and its value is not 'no', add -std=c99
[${ac_cv_prog_cc_c89+:} false && test x"$ac_cv_prog_cc_c89" != xno], [
AX_CHECK_COMPILE_FLAG([-std=c99], [AC_CFLAGS="${AC_CFLAGS} -std=c99"])
]
)
# save CFLAGS before flag testing
AX_VAR_PUSHVALUE([CFLAGS])
# Intel compilers need additional flags to promote unrecognized flags from warning to error
# Ideally, -diag-error=warn should be used, but this flag promotes several other warnings
# that are otherwise hidden. Another solution is to use -diag-error=<code>, but GCC does not
# complain about it. The final solution is to use the flag -we<code>, although deprecated,
# it still works.
# Ref: https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/error-handling-1.html
AX_CHECK_COMPILE_FLAG([-we10006], [CFLAGS="${CFLAGS} -we10006"])
AX_CHECK_COMPILE_FLAG([-we10148], [CFLAGS="${CFLAGS} -we10148"])
# fccpx needs this env. variable to promote unrecognized flags from warning to error
AX_VAR_PUSHVALUE([FCOMP_UNRECOGNIZED_OPTION], [error])
export FCOMP_UNRECOGNIZED_OPTION
AX_CHECK_COMPILE_FLAG([--diag_suppress branch_past_initialization],
[AC_CFLAGS="${AC_CFLAGS} --diag_suppress branch_past_initialization"])
AX_CHECK_COMPILE_FLAG([-pthread], [AC_CFLAGS="${AC_CFLAGS} -pthread"])
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [AC_CFLAGS="${AC_CFLAGS} -fvisibility=hidden"])
AX_CHECK_COMPILE_FLAG([-Wno-unused-result], [AC_CFLAGS="${AC_CFLAGS} -Wno-unused-result"])
AS_IF([test "x$enable_extra_warnings" = xyes], [
AX_CHECK_COMPILE_FLAG([-Wall], [AC_CFLAGS="${AC_CFLAGS} -Wall"])
AX_CHECK_COMPILE_FLAG([-Werror], [AC_CFLAGS="${AC_CFLAGS} -Werror"])
AX_CHECK_COMPILE_FLAG([-Wshadow], [AC_CFLAGS="${AC_CFLAGS} -Wshadow"])
AX_CHECK_COMPILE_FLAG([-Wno-error=shadow], [AC_CFLAGS="${AC_CFLAGS} -Wno-error=shadow"])
AX_CHECK_COMPILE_FLAG([-Wformat-security], [AC_CFLAGS="${AC_CFLAGS} -Wformat-security"])
AX_CHECK_COMPILE_FLAG([-Wsign-compare], [AC_CFLAGS="${AC_CFLAGS} -Wsign-compare"])
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [AC_CFLAGS="${AC_CFLAGS} -Wimplicit-fallthrough"])
AX_CHECK_COMPILE_FLAG([-Wvla], [AC_CFLAGS="${AC_CFLAGS} -Wvla"])
])
AX_CHECK_COMPILE_FLAG([--coverage], [COVERAGE_FLAGS=--coverage])
AX_CHECK_LINK_FLAG([-lm], [AC_LDFLAGS="${AC_LDFLAGS} -lm"])
AX_CHECK_LINK_FLAG([-ldl], [AC_LDFLAGS="${AC_LDFLAGS} -ldl"])
AX_CHECK_LINK_FLAG([-lrt], [AC_LDFLAGS="${AC_LDFLAGS} -lrt"])
AC_CHECK_HEADERS([stdatomic.h])
AC_CHECK_HEADERS([execinfo.h])
AC_CHECK_HEADERS([immintrin.h])
AC_CHECK_HEADERS([emmintrin.h])
# Check cpu_set_t size
AC_CHECK_SIZEOF([cpu_set_t], [], [#include <sched.h>])
AC_SUBST([SIZEOF_CPU_SET_T], [$ac_cv_sizeof_cpu_set_t])
# restore fccpx environment variable
AX_VAR_POPVALUE([FCOMP_UNRECOGNIZED_OPTION])
export FCOMP_UNRECOGNIZED_OPTION
# restore CFLAGS
AX_VAR_POPVALUE([CFLAGS])
# check for __attribute__((alias)) support
AX_CHECK_ATTRIBUTE_ALIAS
##### Fortran Compiler checks #####
AC_PROG_FC
# use Fortran free-form by default
# NOTE: we must override action-if-failure to no-op to avoid erroring if FC is
# not found, because testing FC doesn't seem to work
AC_FC_FREEFORM([:], [:])
# Disable Fortran tests if FC is not found
AS_IF([test "x$FC" = x], [
AC_MSG_WARN([Fortran compiler was not found, some MPI libraries will not be built.])
], [
# use the Fortran compiler for the following checks
AC_LANG_PUSH([Fortran])
# save FCFLAGS before flag testing
AX_VAR_PUSHVALUE([FCFLAGS])
# Intel flags to promote unrecognized flags from warning to error
AX_CHECK_COMPILE_FLAG([-we10148], [FCFLAGS="${FCFLAGS} -we10148"])
AX_CHECK_COMPILE_FLAG([-we10157], [FCFLAGS="${FCFLAGS} -we10157"])
AX_CHECK_COMPILE_FLAG([-pthread], [AC_FCFLAGS="${AC_FCFLAGS} -pthread"])
AS_IF([test "x$enable_extra_warnings" = xyes], [
AX_CHECK_COMPILE_FLAG([-Wall], [AC_FCFLAGS="${AC_FCFLAGS} -Wall"])
AX_CHECK_COMPILE_FLAG([-Wno-c-binding-type], [AC_FCFLAGS="${AC_FCFLAGS} -Wno-c-binding-type"])
AX_CHECK_FC_HONORS_NO_C_BINDING_TYPE([
dnl Old Fortran compilers may not fail with and unrecognized flag
dnl '-Wno-c-binding-type', so flag '-Werror' cannot be used.
AX_CHECK_COMPILE_FLAG([-Werror], [AC_FCFLAGS="${AC_FCFLAGS} -Werror"])
])
])
# restore FCFLAGS
AX_VAR_POPVALUE([FCFLAGS])
AC_LANG_POP([Fortran])
# Check for assumed-rank entity (DIMENSION(..))
AX_CHECK_FC_ASSUMED_RANK
# Check for assumed-type support (TYPE(*)), or defer to REAL
AX_CHECK_FC_IGNORE_TYPE
])
AM_CONDITIONAL([HAVE_FORTRAN], [test "x$FC" != x])
################################################################################
# Configure library versions
################################################################################
AC_MSG_CHECKING([whether to compile the debug variant library])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--disable-debug], [do not compile debug variant library]),
[], dnl Implicit: enable_debug=$enableval
[enable_debug=yes]
)
AC_MSG_RESULT([$enable_debug])
AC_MSG_CHECKING([whether to compile the instrumentation variant library])
AC_ARG_ENABLE([instrumentation],
AS_HELP_STRING([--disable-instrumentation], [do not compile instrumentation variant library]),
[], dnl Implicit: enable_instrumentation=$enableval
[enable_instrumentation=yes]
)
AC_MSG_RESULT([$enable_instrumentation])
AC_MSG_CHECKING([whether to compile the instrumentation-debug variant library])
AC_ARG_ENABLE([instrumentation-debug],
AS_HELP_STRING([--disable-instrumentation-debug],
[do not compile instrumentation debug variant library]),
[], dnl Implicit: enable_instrumentation_debug=$enableval
[enable_instrumentation_debug=yes]
)
AC_MSG_RESULT([$enable_instrumentation_debug])
AM_CONDITIONAL([DEBUG_LIB], [test "x$enable_debug" = xyes])
AM_CONDITIONAL([INSTRUMENTATION_LIB], [test "x$enable_instrumentation" = xyes])
AM_CONDITIONAL([INSTRUMENTATION_DEBUG_LIB], [test "x$enable_instrumentation_debug" = xyes])
TEST_VERSIONS="performance"
AS_IF([test "x$enable_debug" = xyes], [
TEST_VERSIONS="$TEST_VERSIONS debug"
])
AC_SUBST([TEST_VERSIONS])
COMMON_CPPFLAGS="-D_GNU_SOURCE"
PERFO_CFLAGS="-g -O3"
PERFO_FCFLAGS="-g -O3"
PERFO_CPPFLAGS="$COMMON_CPPFLAGS"
DEBUG_CFLAGS="-g -O0"
DEBUG_FCFLAGS="-g -O0"
DEBUG_CPPFLAGS="$COMMON_CPPFLAGS -DDEBUG_VERSION"
INSTR_CFLAGS="-g -O3"
INSTR_FCFLAGS="-g -O3"
INSTR_CPPFLAGS="$COMMON_CPPFLAGS -DINSTRUMENTATION_VERSION"
INSTR_DEBUG_CFLAGS="-g -O0"
INSTR_DEBUG_FCFLAGS="-g -O0"
INSTR_DEBUG_CPPFLAGS="$COMMON_CPPFLAGS -DDEBUG_VERSION -DINSTRUMENTATION_VERSION"
### Coverage ###
AC_MSG_CHECKING([whether to enable coverage profiling])
AC_ARG_ENABLE([coverage],
AS_HELP_STRING([--enable-coverage], [enable coverage profiling]),
[], dnl Implicit: enable_coverage=$enableval
[enable_coverage=no]
)
AC_MSG_RESULT([$enable_coverage])
AS_IF([test "x$enable_coverage" = xyes], [
DEBUG_CFLAGS="$DEBUG_CFLAGS $COVERAGE_FLAGS"
DEBUG_FCFLAGS="$DEBUG_FCFLAGS $COVERAGE_FLAGS"
AC_CHECK_PROG([gcovr], [gcovr], [yes])
AS_IF([test "x$gcovr" != xyes], [
AC_MSG_ERROR([Coverage profiling requires gcovr tool])
])
AS_IF([test "x$enable_static" != xyes], [
AC_MSG_ERROR([--enable-coverage and --disable-static are incompatible options])
])
])
AM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = xyes])
### Python viewer scripts ###
AC_MSG_CHECKING([whether to install DLB python viewer scripts (deprecated)])
AC_ARG_ENABLE([viewer-scripts],
AS_HELP_STRING([--enable-viewer-scripts], [enable deprecated viewer scripts]),
[], dnl Implicit: enable_viewer_scripts=$enableval
[enable_viewer_scripts=no]
)
AC_MSG_RESULT([$enable_viewer_scripts])
AM_CONDITIONAL([ENABLE_VIEWER_SCRIPTS], [test "x$enable_viewer_scripts" = xyes])
AC_SUBST([PERFO_CFLAGS])
AC_SUBST([PERFO_FCFLAGS])
AC_SUBST([PERFO_CPPFLAGS])
AC_SUBST([DEBUG_CFLAGS])
AC_SUBST([DEBUG_FCFLAGS])
AC_SUBST([DEBUG_CPPFLAGS])
AC_SUBST([INSTR_CFLAGS])
AC_SUBST([INSTR_FCFLAGS])
AC_SUBST([INSTR_CPPFLAGS])
AC_SUBST([INSTR_DEBUG_CFLAGS])
AC_SUBST([INSTR_DEBUG_FCFLAGS])
AC_SUBST([INSTR_DEBUG_CPPFLAGS])
################################################################################
# Configure external libraries and programs
################################################################################
# Check for Python versions
AX_COMPARE_VERSION([$PYTHON_VERSION], [ge], [2.7], [have_py27=yes], [have_py27=no])
AM_CONDITIONAL([HAVE_PYTHON27], [test "x$have_py27" = xyes])
AX_COMPARE_VERSION([$PYTHON_VERSION], [ge], [3.6], [have_py36=yes], [have_py36=no])
AM_CONDITIONAL([HAVE_PYTHON36], [test "x$have_py36" = xyes])
# check for OpenMP availability
AC_OPENMP
AM_CONDITIONAL([HAVE_OPENMP], [test -n "$OPENMP_CFLAGS" || test "x$ac_cv_prog_c_openmp" = "xnone needed"])
# Fix OpenMP flag for icx
AS_IF([echo "$CC $OPENMP_CFLAGS" | grep -q "icx.*-fopenmp"], [
AC_MSG_NOTICE([icx with -fopenmp detected, using -qopenmp instead])
OPENMP_CFLAGS="-qopenmp"
])
# check for MPI
AC_ARG_VAR([MPICC], [MPI C compiler wrapper])
AC_ARG_VAR([MPIFC], [MPI Fortran compiler wrapper])
AX_MPI
# check for HWLOC
AX_HWLOC
# check for PAPI
AX_PAPI
# check for CUDA
AX_CUDA
# check for ROCm
AX_ROCM
# check for SPHINX
AC_ARG_ENABLE([sphinx-doc],
AS_HELP_STRING([--disable-sphinx-doc], [disable sphinx-doc detection]),
[], dnl Implicit: enable_sphinx_doc=$enableval
[enable_sphinx_doc=yes]
)
AS_IF([test "x$enable_sphinx_doc" = xyes], [
AC_CHECK_PROG([sphinx], [sphinx-build], [yes])
], [
AC_MSG_CHECKING([for sphinx-build])
AC_MSG_RESULT([skipped])
sphinx=no
])
AM_CONDITIONAL([HAVE_SPHINX], [test "x$sphinx" = xyes])
# check for Doxygen
AC_ARG_ENABLE([doxygen],
AS_HELP_STRING([--disable-doxygen], [disable doxygen detection]),
[], dnl Implicit: enable_doxygen=$enableval
[enable_doxygen=yes]
)
AS_IF([test "x$enable_doxygen" = xyes], [
AC_CHECK_PROG([doxygen], [doxygen], [yes])
], [
AC_MSG_CHECKING([for doxygen])
AC_MSG_RESULT([skipped])
doxygen=no
])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$doxygen" = xyes])
AM_COND_IF([HAVE_DOXYGEN], [
# Doxygen < '1.8.16' had some bugs with underline HTML tags:
AC_MSG_CHECKING([doxygen version])
doxygen_version="`doxygen --version`"
AC_MSG_RESULT([$doxygen_version])
AX_COMPARE_VERSION([$doxygen_version], [ge], [1.8.16],
[DOXYGEN_ALIASES="underline{1}=\"<U>\\1</U>\""],
[DOXYGEN_ALIASES="underline{1}=\"\\1\""])
])
AC_SUBST([DOXYGEN_ALIASES])
# check for Pandoc
AC_ARG_ENABLE([pandoc],
AS_HELP_STRING([--disable-pandoc], [disable pandoc detection]),
[], dnl Implicit: enable_pandoc=$enableval
[enable_pandoc=yes]
)
AS_IF([test "x$enable_pandoc" = xyes], [
AC_CHECK_PROG([pandoc], [pandoc], [yes])
], [
AC_MSG_CHECKING([for pandoc])
AC_MSG_RESULT([skipped])
pandoc=no
])
AS_IF([test "x$pandoc" = xyes], [
AC_MSG_CHECKING([whether pandoc supports the required formats])
AS_IF([! pandoc --from=man --to=rst /dev/null > /dev/null 2>&1], [
pandoc=no
])
AC_MSG_RESULT([$pandoc])
])
AM_CONDITIONAL([HAVE_PANDOC], [test "x$pandoc" = xyes])
# Check if Sphinx will include man pages
AM_CONDITIONAL([SPHINX_HAS_MANPAGES], [test "x$pandoc" = xyes && test "x$doxygen" = xyes])
AM_COND_IF([SPHINX_HAS_MANPAGES], [
SPHINX_HAS_MANPAGES=""
], [
SPHINX_HAS_MANPAGES=".. "
])
AC_SUBST([SPHINX_HAS_MANPAGES])
AC_CONFIG_HEADERS([config.h])
# files to generate via autotools (.am or .in source files)
AC_CONFIG_FILES([
Makefile
tests/Makefile
cmake/DLBConfigVersion.cmake
doc/examples/barrier/Makefile
doc/examples/drom/Makefile
doc/examples/lewi_custom_rt/run.sh
doc/examples/lewi_custom_rt/Makefile
doc/examples/lewi_mask_consumer/run.sh
doc/examples/lewi_mask_consumer/Makefile
doc/examples/mpi+omp/run.sh
doc/examples/mpi+omp/Makefile
doc/examples/mpi+omp_ompt/run.sh
doc/examples/mpi+omp_ompt/Makefile
doc/examples/mpi+omp_roleshift/run.sh
doc/examples/mpi+omp_roleshift/Makefile
doc/examples/mpi+ompss/run.sh
doc/examples/mpi+ompss/Makefile
doc/examples/named_barrier/Makefile
doc/examples/ompt/Makefile
doc/examples/python/run_drom_01.sh
doc/examples/python/run_talp_01.sh
doc/examples/statistics/run.sh
doc/examples/statistics/Makefile
doc/examples/talp/run.sh
doc/examples/talp/Makefile
doc/examples/monitoring_regions/run.sh
doc/examples/monitoring_regions/Makefile
doc/scripts/lewi_omp.sh
doc/scripts/lewi_omp_trace.sh
doc/scripts/lewi_ompss_trace.sh
doc/scripts/talp.sh
doc/doxygen/Doxyfile
doc/doxygen/Doxyfile_man1
doc/doxygen/Doxyfile_man3
doc/user_guide/source/dlb_version.py
doc/user_guide/source/index.rst
src/apis/dlb.h
src/apis/python_bindings/dlb.py
])
AC_CONFIG_FILES([tests/gens/basic-generator], [chmod +x tests/gens/basic-generator])
AC_CONFIG_FILES([tests/gens/fortran-generator], [chmod +x tests/gens/fortran-generator])
AC_CONFIG_FILES([tests/gens/mpi-generator], [chmod +x tests/gens/mpi-generator])
# Some user guide files are generated, link the rest if necessary to the build dir
AC_CONFIG_LINKS([
doc/user_guide/source/conf.py:doc/user_guide/source/conf.py
doc/user_guide/source/advance_usage.rst:doc/user_guide/source/advance_usage.rst
doc/user_guide/source/api.rst:doc/user_guide/source/api.rst
doc/user_guide/source/citing_dlb.rst:doc/user_guide/source/citing_dlb.rst
doc/user_guide/source/contents.rst:doc/user_guide/source/contents.rst
doc/user_guide/source/dlb_barrier.rst:doc/user_guide/source/dlb_barrier.rst
doc/user_guide/source/faq.rst:doc/user_guide/source/faq.rst
doc/user_guide/source/installation.rst:doc/user_guide/source/installation.rst
doc/user_guide/source/how_to_run.rst:doc/user_guide/source/how_to_run.rst
doc/user_guide/source/how_to_run_lewi.rst:doc/user_guide/source/how_to_run_lewi.rst
doc/user_guide/source/how_to_run_drom.rst:doc/user_guide/source/how_to_run_drom.rst
doc/user_guide/source/how_to_run_talp.rst:doc/user_guide/source/how_to_run_talp.rst
doc/user_guide/source/talp_metrics.rst:doc/user_guide/source/talp_metrics.rst
doc/user_guide/source/talp_pages.rst:doc/user_guide/source/talp_pages.rst
doc/user_guide/source/overview.rst:doc/user_guide/source/overview.rst
doc/user_guide/source/man_pages_appendix.rst:doc/user_guide/source/man_pages_appendix.rst
doc/user_guide/source/technical_requirements.rst:doc/user_guide/source/technical_requirements.rst
doc/user_guide/source/images/dlb_logo.png:doc/user_guide/source/images/dlb_logo.png
doc/user_guide/source/images/dlb_logo_white.png:doc/user_guide/source/images/dlb_logo_white.png
doc/user_guide/source/images/dlb_states.png:doc/user_guide/source/images/dlb_states.png
doc/user_guide/source/images/dlb_icon.png:doc/user_guide/source/images/dlb_icon.png
doc/user_guide/source/images/dlb_icon.ico:doc/user_guide/source/images/dlb_icon.ico
doc/user_guide/source/images/drom.png:doc/user_guide/source/images/drom.png
doc/user_guide/source/images/hpc_app.png:doc/user_guide/source/images/hpc_app.png
doc/user_guide/source/images/LeWI.png:doc/user_guide/source/images/LeWI.png
doc/user_guide/source/images/talp.png:doc/user_guide/source/images/talp.png
doc/user_guide/source/images/talp-efficiency-models-all.drawio.svg:doc/user_guide/source/images/talp-efficiency-models-all.drawio.svg
doc/user_guide/source/images/talp-efficiency-models-device.png:doc/user_guide/source/images/talp-efficiency-models-device.png
doc/user_guide/source/images/talp-efficiency-models.drawio.svg:doc/user_guide/source/images/talp-efficiency-models.drawio.svg
doc/user_guide/source/images/talp-efficiency-models-host.png:doc/user_guide/source/images/talp-efficiency-models-host.png
doc/user_guide/source/images/talp-efficiency-models.png:doc/user_guide/source/images/talp-efficiency-models.png
doc/user_guide/source/images/ld_preload.png:doc/user_guide/source/images/ld_preload.png
doc/user_guide/source/_static/custom.css:doc/user_guide/source/_static/custom.css
])
################################################################################
# Host specific options
################################################################################
AS_CASE([$host],
[powerpc64-bgq-linux*], [
AC_DEFINE([IS_BGQ_MACHINE], [1], [Defined if this machine is a BGQ machine])
AC_LDFLAGS="${AC_LDFLAGS} -dynamic"
ncpus=64
], [
ncpus=$(getconf _NPROCESSORS_ONLN) || ncpus=1
]
)
AC_DEFINE_UNQUOTED([NCPUS_AT_CONFIGURE_TIME], [$ncpus], [Number of CPUs detected at cofigure time])
################################################################################
AC_SUBST([AC_CFLAGS])
AC_SUBST([AC_FCFLAGS])
AC_SUBST([AC_LDFLAGS])
# generate the final Makefile etc.
AC_OUTPUT
# Generate an underlined title
summary_title="$PACKAGE_STRING configuration summary"
summary_title_len="${#summary_title}"
summary_title_underline="$(printf '%*s' "$summary_title_len" | tr ' ' '=')"
# Generate variant strings
AS_IF([test "x$enable_debug" = xyes],
[debug_variant="yes (libdlb_dbg.so)"], [debug_variant=no])
AS_IF([test "x$enable_instrumentation" = xyes],
[instr_variant="yes (libdlb_instr.so)"], [instr_variant=no])
AS_IF([test "x$enable_instrumentation_debug" = xyes],
[instr_debug_variant="yes (libdlb_instr_dbg.so)"], [instr_debug_variant=no])
AS_IF([test "x$BUILD_MPI_LIB" = xyes],
[mpi_lib_variant="yes (libdlb_mpi.so)"], [mpi_lib_variant=no])
AS_IF([test "x$BUILD_MPIC_LIB" = xyes],
[mpic_lib_variant="yes (libdlb_mpic.so)"], [mpic_lib_variant=no])
AS_IF([test "x$BUILD_MPIF_LIB" = xyes],
[mpif_lib_variant="yes (libdlb_mpif.so)"], [mpif_lib_variant=no])
# MPI info
AS_IF([test "x$with_mpi" != xno], [
mpi_info="
F08 bindings : $mpi_f08
F08ts bindings : $mpi_f08ts
CPPFLAGS : $MPI_CPPFLAGS
LDFLAGS : $MPI_LDFLAGS"
], [
mpi_info=""
])
# Other dependences:
AS_IF([test "x$with_papi" != xno], [
papi_plugin="yes (libdlb_papi.so)"
papi_info="
CPPFLAGS : $PAPI_CPPFLAGS
LDFLAGS : $PAPI_LDFLAGS"
], [
papi_plugin="no"
papi_info=""
])
AS_IF([test "x$with_cuda" != xno], [
cuda_plugin="yes (libdlb_cupti.so)"
cuda_info="
CPPFLAGS : $CUDA_CPPFLAGS
LDFLAGS : $CUDA_LDFLAGS"
], [
cuda_plugin="no"
cuda_info=""
])
AS_IF([test "x$with_rocm" != xno], [
AS_IF([test "x$rocm_rocprofsdk_plugin" = xyes && test "x$rocm_rocprofv2_plugin" = xyes], [
rocm_plugin="yes (libdlb_rocprofiler-sdk.so and libdlb_rocprofilerv2.so)"
rocm_info="
CPPFLAGS : $ROCM_CPPFLAGS
LDFLAGS (sdk) : $ROCM_ROCPROFSDK_LDFLAGS
LDFLAGS (v2) : $ROCM_ROCPROFV2_LDFLAGS"
], [test "x$rocm_rocprofsdk_plugin" = xyes], [
rocm_plugin="yes (libdlb_rocprofiler-sdk.so)"
rocm_info="
CPPFLAGS : $ROCM_CPPFLAGS
LDFLAGS : $ROCM_ROCPROFSDK_LDFLAGS"
], [test "x$rocm_rocprofv2_plugin" = xyes], [
rocm_plugin="yes (libdlb_rocprofilerv2.so)"
rocm_info="
CPPFLAGS : $ROCM_CPPFLAGS
LDFLAGS : $ROCM_ROCPROFV2_LDFLAGS"
])
], [
rocm_plugin="no"
rocm_info=""
])
AS_IF([test "x$with_hwloc" != xno], [
hwloc_dep="yes"
hwloc_info="
CPPFLAGS : $HWLOC_CPPFLAGS
LDFLAGS : $HWLOC_LDFLAGS"
], [
hwloc_dep="no"
hwloc_info=""
])
# Summary
AS_ECHO(["
$summary_title
$summary_title_underline
Installation prefix : $prefix
Main libraries
--------------
Default : yes (libdlb.so)
Debug variant : $debug_variant
Instrumentation variant : $instr_variant
Instr + debug variant : $instr_debug_variant
MPI variants
------------
C and Fortran MPI library : $mpi_lib_variant
C MPI library : $mpic_lib_variant
Fortran MPI library : $mpif_lib_variant$mpi_info
Optional plugins
----------------
PAPI plugin : $papi_plugin$papi_info
CUDA plugin : $cuda_plugin$cuda_info
ROCm plugin : $rocm_plugin$rocm_info
Other libraries
---------------
HWLOC : $hwloc_dep$hwloc_info"])