-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfigure.ac
84 lines (74 loc) · 2.02 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
AC_INIT([atools], [1.5.2], [[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror foreign tar-pax])
AC_CONFIG_FILES([
Makefile
bin/Makefile
conf/Makefile
lib/Makefile
lib/vsc/Makefile
lib/vsc/atools/Makefile
reduce/Makefile
tmpls/Makefile
])
# set batch system option
AC_ARG_WITH(
[batchsystem],
AS_HELP_STRING(
[--with-batchsystem=SYSTEM],
[Scheduler to use: torque, moab, sge, slurm; default=slurm]
)
)
# set reduce mode option
AC_ARG_WITH(
[reducemode],
AS_HELP_STRING(
[--with-reducemode=MODE],
[reduce mode to use as default: text, body, csv; default=text]
)
)
# set shell options
AC_ARG_WITH(
[shell],
AS_HELP_STRING(
[--with-shell=SHELL],
[shell that is considered default: bash, sh, tcsh, csh; default=bash]
)
)
# if unset, set batch system to default, check validity
AS_IF([test "x$with_batchsystem" == "x"], [with_batchsystem=slurm])
AS_CASE([$with_batchsystem],
[torque], [],
[moab], [],
[sge], [],
[slurm], [],
[AC_MSG_ERROR([batch system should be one of torque, moab, sge, slurm])]
)
# if unset, set reduce mode to default, check validity
AS_IF([test "x$with_reducemode" == "x"], [with_reducemode=text])
AS_CASE([$with_reducemode],
[text], [],
[body], [],
[csv], [],
[AC_MSG_ERROR([reduce mode should be one of text, body, csv])]
)
# if unset, set shell to default, check validity
AS_IF([test "x$with_shell" == "x"], [with_shell=bash])
AS_CASE([$with_shell],
[bash], [],
[sh], [],
[tcsh], [],
[csh], [],
[AC_MSG_ERROR([default shell should be one of bash, sh, tcsh, csh])]
)
# create atools_python.sh file
python_path=$(which python)
AC_MSG_NOTICE([Setting Python to $python_path...])
echo "export PYTHON=\"${python_path}\"" > conf/atools_python.sh
# create atools.conf
AC_MSG_NOTICE([Creatign atools.conf...])
m4 \
-DBATCH_SYSTEM=$with_batchsystem \
-DMODE=$with_reducemode \
-DSHELL=$with_shell \
conf/atools.conf.m4 > conf/atools.conf
AC_OUTPUT