forked from BSC-RM/slurm_simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
x_ac_debug.m4
136 lines (129 loc) · 4.68 KB
/
x_ac_debug.m4
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
##*****************************************************************************
# $Id$
##*****************************************************************************
# AUTHOR:
# Chris Dunlap <cdunlap@llnl.gov>
#
# SYNOPSIS:
# X_AC_DEBUG
#
# DESCRIPTION:
# Add support for the "--enable-debug", "--enable-memory-leak-debug",
# "--disable-partial-attach" and "--enable-front-end" configure script
# options.
# If debugging is enabled, CFLAGS will be prepended with the debug flags.
# The NDEBUG macro (used by assert) will also be set accordingly.
#
# WARNINGS:
# This macro must be placed after AC_PROG_CC or equivalent.
##*****************************************************************************
AC_DEFUN([X_AC_DEBUG], [
AC_MSG_CHECKING([whether debugging is enabled])
AC_ARG_ENABLE(
[debug],
AS_HELP_STRING(--enable-debug,enable debugging code for development),
[ case "$enableval" in
yes) x_ac_debug=yes ;;
no) x_ac_debug=no ;;
*) AC_MSG_RESULT([doh!])
AC_MSG_ERROR([bad value "$enableval" for --enable-debug]) ;;
esac
]
)
if test "$x_ac_debug" = yes; then
test "$GCC" = yes && CFLAGS="$CFLAGS -Wall -fno-strict-aliasing"
test "$GXX" = yes && CXXFLAGS="$CXXFLAGS -Wall -fno-strict-aliasing"
else
AC_DEFINE([NDEBUG], [1],
[Define to 1 if you are building a production release.]
)
fi
AC_MSG_RESULT([${x_ac_debug=no}])
AC_MSG_CHECKING([whether memory leak debugging is enabled])
AC_ARG_ENABLE(
[memory-leak-debug],
AS_HELP_STRING(--enable-memory-leak-debug,enable memory leak debugging code for development),
[ case "$enableval" in
yes) x_ac_memory_debug=yes ;;
no) x_ac_memory_debug=no ;;
*) AC_MSG_RESULT([doh!])
AC_MSG_ERROR([bad value "$enableval" for --enable-memory-leak-debug]) ;;
esac
]
)
if test "$x_ac_memory_debug" = yes; then
AC_DEFINE(MEMORY_LEAK_DEBUG, 1, [Define to 1 for memory leak debugging.])
fi
AC_MSG_RESULT([${x_ac_memory_debug=no}])
AC_MSG_CHECKING([whether to enable slurmd operation on a front-end])
AC_ARG_ENABLE(
[front-end],
AS_HELP_STRING(--enable-front-end, enable slurmd operation on a front-end),
[ case "$enableval" in
yes) x_ac_front_end=yes ;;
no) x_ac_front_end=no ;;
*) AC_MSG_RESULT([doh!])
AC_MSG_ERROR([bad value "$enableval" for --enable-front-end]) ;;
esac
]
)
if test "$x_ac_front_end" = yes; then
AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
fi
AC_MSG_RESULT([${x_ac_front_end=no}])
AC_MSG_CHECKING([whether debugger partial attach enabled])
AC_ARG_ENABLE(
[partial-attach],
AS_HELP_STRING(--disable-partial-attach,disable debugger partial task attach support),
[ case "$enableval" in
yes) x_ac_partial_attach=yes ;;
no) x_ac_partial_attach=no ;;
*) AC_MSG_RESULT([doh!])
AC_MSG_ERROR([bad value "$enableval" for --enable-partial-leak-attach]) ;;
esac
]
)
if test "$x_ac_partial_attach" != "no"; then
AC_DEFINE(DEBUGGER_PARTIAL_ATTACH, 1, [Define to 1 for debugger partial task attach support.])
fi
AC_MSG_RESULT([${x_ac_partial_attach=no}])
AC_MSG_CHECKING([whether salloc should kill child processes at job termination])
AC_ARG_ENABLE(
[salloc-kill-cmd],
AS_HELP_STRING(--enable-salloc-kill-cmd,salloc should kill child processes at job termination),
[ case "$enableval" in
yes) x_ac_salloc_kill_cmd=yes ;;
no) x_ac_salloc_kill_cmd=no ;;
*) AC_MSG_RESULT([doh!])
AC_MSG_ERROR([bad value "$enableval" for --enable-salloc-kill-cmd]) ;;
esac
]
)
if test "$x_ac_salloc_kill_cmd" = yes; then
AC_DEFINE(SALLOC_KILL_CMD, 1, [Define to 1 for salloc to kill child processes at job termination])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
# NOTE: Default value of SALLOC_RUN_FOREGROUND is system dependent
# x_ac_salloc_background is set to "no" for Cray systems in x_ac_cray.m4
AC_MSG_CHECKING([whether to disable salloc execution in the background])
AC_ARG_ENABLE(
[salloc-background],
AS_HELP_STRING(--disable-salloc-background,disable salloc execution in the background),
[ case "$enableval" in
yes) x_ac_salloc_background=yes ;;
no) x_ac_salloc_background=no ;;
*) AC_MSG_RESULT([doh!])
AC_MSG_ERROR([bad value "$enableval" for --disable-salloc-background]) ;;
esac
]
)
if test "$x_ac_salloc_background" = no; then
AC_DEFINE(SALLOC_RUN_FOREGROUND, 1, [Define to 1 to require salloc execution in the foreground.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
]
)