-
Notifications
You must be signed in to change notification settings - Fork 4
/
acsm_compiler_control_args.m4
120 lines (113 loc) · 5.19 KB
/
acsm_compiler_control_args.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
AC_DEFUN([ACSM_COMPILER_CONTROL_ARGS],
[
# -------------------------------------------------------------------
# MPI -- enabled by default. Check for it now so we can be somewhat
# smart about which compilers to look for
# -------------------------------------------------------------------
AC_ARG_ENABLE(mpi,
AS_HELP_STRING([--disable-mpi],
[build without MPI message passing support]),
[AS_CASE("${enableval}",
[yes], [enablempi=yes],
[no], [enablempi=no],
[AC_MSG_ERROR(bad value ${enableval} for --enable-mpi)])],
[enablempi=yes])
AC_ARG_WITH([mpi],
AS_HELP_STRING([--with-mpi@<:@=DIR@:>@],
[Prefix where MPI is installed (default is MPIHOME and then MPI_HOME)]),
[
dnl We have no way of knowing whether the user explicitly enabled mpi
dnl with --enable-mpi or whether it was set by default, so if the user
dnl specified --with-mpi=no or --without-mpi we're just going to tell them they've given
dnl competing options
AS_IF([test "$enablempi" = yes && test "$withval" = no],
[AC_MSG_ERROR([Did you mean to disable MPI? If you really mean it, use the --disable-mpi option instead])]
)
MPI="$withval"
],
[
AS_ECHO(["note: MPI library path not given..."])
AS_IF([test x"$MPIHOME" != x],
[
AS_ECHO(["trying prefix=$MPIHOME"])
MPI=$MPIHOME
],
[
AS_IF([test x"$MPI_HOME" != x],
[
AS_ECHO(["trying prefix=$MPI_HOME"])
MPI=$MPI_HOME
])
])
])
AC_ARG_WITH([mpi],
AS_HELP_STRING([--with-mpi@<:@=DIR@:>@],
[Prefix where MPI is installed (default is MPIHOME and then MPI_HOME)]),
[
dnl We have no way of knowing whether the user explicitly enabled mpi
dnl with --enable-mpi or whether it was set by default, so if the user
dnl specified --with-mpi=no or --without-mpi we're just going to tell them they've given
dnl competing options
AS_IF([test "$enablempi" = yes && test "$withval" = no],
[AC_MSG_ERROR([Did you mean to disable MPI? If you really mean it, use the --disable-mpi option instead])]
)
MPI="$withval"
],
[
AS_ECHO(["note: MPI library path not given..."])
AS_IF([test x"$MPIHOME" != x],
[
AS_ECHO(["trying prefix=$MPIHOME"])
MPI=$MPIHOME
],
[
AS_IF([test x"$MPI_HOME" != x],
[
AS_ECHO(["trying prefix=$MPI_HOME"])
MPI=$MPI_HOME
])
])
])
AC_ARG_WITH([mpi-include],
AS_HELP_STRING([--with-mpi-include@<:@=DIR@:>@],
[Prefix where MPI headers are installed (default is --with-mpi+/include)]),
[
MPI_INCLUDES_PATH="$withval"
],
[
MPI_INCLUDES_PATH="$MPI/include"
])
AC_ARG_WITH([mpi-lib],
AS_HELP_STRING([--with-mpi-lib@<:@=DIR@:>@],
[Prefix where MPI binaries are installed (default is --with-mpi+/lib)]),
[
MPI_LIBS_PATH="$withval"
],
[
MPI_LIBS_PATH="$MPI/lib"
])
#
# --------------------------------------------------------------
# Allow for disable-optional
# --------------------------------------------------------------
AC_ARG_ENABLE(optional,
AS_HELP_STRING([--disable-optional],
[build without most optional external libraries]),
[AS_CASE("${enableval}",
[yes], [enableoptional=yes],
[no], [enableoptional=no],
[AC_MSG_ERROR(bad value ${enableval} for --enable-optional)])],
[enableoptional=yes])
# ----------------------------------------------------------------------
# PETSc is our usual solver package. We place this configure option here
# because we may use its CXX for our own compiles
# ----------------------------------------------------------------------
AC_ARG_ENABLE(petsc,
AS_HELP_STRING([--disable-petsc],
[build without PETSc iterative solver support]),
[AS_CASE("${enableval}",
[yes], [enablepetsc=yes;enablepetsc_mpi=yes],
[no], [enablepetsc=no;enablepetsc_mpi=no],
[AC_MSG_ERROR(bad value ${enableval} for --enable-petsc)])],
[enablepetsc=$enableoptional;enablepetsc_mpi=$enableoptional])
])