-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
234 lines (193 loc) · 8 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
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([planet], [0.0.0], [[email protected]], [planet])
PACKAGE_DESCRIPTION="A planet's atmospheric code using Antioch, adapted to Titan"
AC_SUBST([PACKAGE_DESCRIPTION])
PACKAGE_URL=""
AC_SUBST([PACKAGE_URL])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER(planet_config.h.tmp)
dnl Prefixes everything in the temporary file with FINS_
AX_PREFIX_CONFIG_H(planet_config.h,PLANET,planet_config.h.tmp)
AC_CONFIG_AUX_DIR([build-aux])
AC_CANONICAL_TARGET()
AM_INIT_AUTOMAKE([dist-bzip2 tar-ustar 1.11 no-define color-tests parallel-tests])
AM_SILENT_RULES(yes) # use silent rules where available - automake 1.11
LT_INIT
dnl Release versioning
AX_SPLIT_VERSION
GENERIC_MAJOR_VERSION=$AX_MAJOR_VERSION
GENERIC_MINOR_VERSION=$AX_MINOR_VERSION
GENERIC_MICRO_VERSION=$AX_POINT_VERSION
GENERIC_LIBRARY_NAME=planet
dnl shared library versioning
PACKAGE=$GENERIC_LIBRARY_NAME
GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
dnl AC_SUBST(GENERIC_LIBRARY_VERSION)
dnl AC_SUBST(GENERIC_LIBRARY_NAME)
AC_SUBST(GENERIC_VERSION)
AC_SUBST(GENERIC_RELEASE)
AC_SUBST(GENERIC_MAJOR_VERSION)
AC_SUBST(GENERIC_MINOR_VERSION)
AC_SUBST(GENERIC_MICRO_VERSION)
AC_DEFINE_UNQUOTED([MAJOR_VERSION],$GENERIC_MAJOR_VERSION,[Major version])
AC_DEFINE_UNQUOTED([MINOR_VERSION],$GENERIC_MINOR_VERSION,[Minor version])
AC_DEFINE_UNQUOTED([MICRO_VERSION],$GENERIC_MICRO_VERSION,[Micro version])
dnl------------------------------
dnl Checks for compilers
dnl------------------------------
AC_PROG_CC
AC_PROG_CXX
dnl Added for AX_CODE_COVERAGE macro to work correctly, even though there's no Fortran here.
AC_PROG_FC
dnl Allow users to make vectorized tests larger
AC_ARG_WITH([n_tuples],
AC_HELP_STRING([--with-n_tuples=<1...1000000000>],
[number of tuples used in each vector test]),
[n_tuples="$withval"],
[n_tuples=2])
AC_DEFINE_UNQUOTED(N_TUPLES, $n_tuples, [number of tuples used in each vector test])
dnl Allow users to make vectorized tests longer
AC_ARG_WITH([n_runs],
AC_HELP_STRING([--with-n_runs=<1...1000000000>],
[number of runs done in each vector test]),
[n_runs="$withval"],
[n_runs=1])
AC_DEFINE_UNQUOTED(N_RUNS, $n_runs, [number of runs done in each vector test])
dnl------------------------
dnl Checks dependencies
dnl--------------------------
# Check for Antioch
AX_PATH_ANTIOCH(0.0.0,yes)
# GRINS
AX_PATH_GRINS(0.4.0,yes)
# Libmesh flags
AC_ARG_ENABLE([libmesh-flags],
AC_HELP_STRING([--disable-libmesh-flags],[disable use of libmesh cxxflags for CXXFLAGS]),
[case "${enableval}" in
yes) USE_LIBMESH_CXX_FLAGS=1 ;;
no) USE_LIBMESH_CXX_FLAGS=0 ;;
*) AC_MSG_ERROR(bad value ${enableval} for libmesh-flags) ;;
esac],
[USE_LIBMESH_CXX_FLAGS=1])
if test "$USE_LIBMESH_CXX_FLAGS" = "1"; then
AC_DEFINE(USE_LIBMESH_CXX_FLAGS,1,[Define if libmesh cxxflags enabled])
CXXFLAGS=`$LIBMESH_CONFIG --cppflags --cxxflags`
else
dnl TODO: WE NEED TO DISTINGUISH BETWEEN COMPILERS IN A BETTER WAY
AC_DEFINE(USE_LIBMESH_CXX_FLAGS,0,[Define if libmesh cxxflags enabled])
CXXFLAGS="-O0 -g -fno-unsafe-math-optimizations"
fi
# eigen
CONFIGURE_EIGEN(2.3.0,yes)
# GSL for spline method
AX_PATH_GSL_NEW(1.10,yes)
dnl -Wall warnings, -Wall the time.
AX_CXXFLAGS_WARN_ALL
dnl--------------------------
dnl Even if no dependency needed it,
dnl C++11 makes our asserts nicer,
dnl so let's try and enable it.
dnl--------------------------
AC_ARG_ENABLE(cxx11,
AC_HELP_STRING([--enable-cxx11],
[build with C++11 support]),
[case "${enableval}" in
yes) enablecxx11=yes ;;
no) enablecxx11=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-cxx11) ;;
esac],
[enablecxx11=optional])
if (test x$enablecxx11 = xyes); then
AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
AX_CXX_AUTO_THIS(optional)
elif (test x$enablecxx11 = xoptional); then
AX_CXX_COMPILE_STDCXX_11(noext, optional)
AX_CXX_AUTO_THIS(optional)
fi
dnl--------------------------
dnl Checks grvy, may want to
dnl to brutally import grins
dnl config
dnl--------------------------
AX_PATH_GRVY_NEW([0.30],[no])
dnl--------------------------
dnl Checks for code coverage
dnl--------------------------
AX_CODE_COVERAGE
dnl---------------------------------
dnl Query configuration environment
dnl Must be done *before* Doxygen to
dnl get some happy variables defined.
dnl---------------------------------
AX_SUMMARIZE_ENV
dnl------------------------------------------
dnl Doxygen support
dnl------------------------------------------
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN(planet, doxygen/planet.dox, docs/doxygen)
AC_CONFIG_FILES(doxygen/txt_common/about_vpath.page)
dnl-----------------------------------------------
dnl Generate files for unit and regression testing
dnl-----------------------------------------------
AC_CONFIG_FILES(test/temperature_unit.sh, [chmod +x test/temperature_unit.sh])
AC_CONFIG_FILES(test/photon_opacity_unit.sh, [chmod +x test/photon_opacity_unit.sh])
AC_CONFIG_FILES(test/atmospheric_mixture_unit.sh, [chmod +x test/atmospheric_mixture_unit.sh])
AC_CONFIG_FILES(test/photon_evaluator_unit.sh, [chmod +x test/photon_evaluator_unit.sh])
AC_CONFIG_FILES(test/eddy_diffusion_evaluator_unit.sh, [chmod +x test/eddy_diffusion_evaluator_unit.sh])
AC_CONFIG_FILES(test/molecular_diffusion_evaluator_unit.sh, [chmod +x test/molecular_diffusion_evaluator_unit.sh])
AC_CONFIG_FILES(test/diffusion_evaluator_unit.sh, [chmod +x test/diffusion_evaluator_unit.sh])
AC_CONFIG_FILES(test/physics_helper_unit.sh, [chmod +x test/physics_helper_unit.sh])
AC_CONFIG_FILES(test/solver_test.sh, [chmod +x test/solver_test.sh])
AC_CONFIG_FILES(test/ionospheric_test.sh, [chmod +x test/ionospheric_test.sh])
AC_CONFIG_FILES(test/input/solver_test.in)
AC_CONFIG_FILES(test/input/grins_input_physics_helper.in)
dnl-----------------------------------------------
dnl Generate header files
dnl-----------------------------------------------
AC_CONFIG_FILES(src/utilities/include/planet/planet_version.h)
dnl-----------------------------------------------
dnl Generate Makefiles and other templated things
dnl-----------------------------------------------
AC_CONFIG_FILES([
planet.pc
doxygen/Makefile
doxygen/planet.dox
Makefile
src/Makefile
test/Makefile
])
dnl-----------------------------------------------
dnl Collect files for "header stamping" here (from Antioch)
dnl-----------------------------------------------
# PB: Although the documentation says that ac_top_srcdir should be defined,
# it doesn't get activated until _AC_SRCDIRS gets called
# (used to be _AC_SRCPATHS), according to this thread:
# http://lists.gnu.org/archive/html/autoconf-patches/2003-02/msg00003.html
# My own hacking revealed that we could also do the following:
# TOP_SEARCH_DIR=$ac_pwd/$srcdir
# I'm not sure which will be more "future proof", but this is the alternative
# to using $(shell) calls in the Makefile.am which 1. requires
# GNU Make and 2. Causes automake to issue a warning
_AC_SRCDIRS(.)
TOP_SEARCH_DIR=$ac_abs_top_srcdir
# We have to do this by subdirectory because otherwise distcheck
# breaks as we start picking up files in the directories
# that it uses.
PLANET_STAMPED_FILES=$(find $TOP_SEARCH_DIR/{src,test} -name "*.h" -or -name "*.C" | tr "\n" " ")
AC_SUBST(PLANET_STAMPED_FILES)
# Must still call AC_OUTPUT() after generating all the files
AC_OUTPUT()
dnl------------------------------
dnl Final summary
dnl------------------------------
AX_SUMMARIZE_CONFIG