forked from roystgnr/MetaPhysicL
-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
238 lines (186 loc) · 7.9 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
235
236
237
238
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(metaphysicl, 1.4.0, [email protected])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([src/utilities/include/metaphysicl/metaphysicl_config.h.tmp])
dnl Prefixes everything in the temporary file with METAPHYSICL_
AX_PREFIX_CONFIG_H(src/utilities/include/metaphysicl/metaphysicl_config.h,METAPHYSICL,src/utilities/include/metaphysicl/metaphysicl_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 subdir-objects])
AM_SILENT_RULES(yes) # use silent rules where available - automake 1.11
dnl Turn off AM_MAINTAINER_MODE for bootstrapped release by
dnl uncommenting this:
dnl AM_MAINTAINER_MODE # git trashes timestamps, forcing autoreconf needlessly
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=metaphysicl
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])
#---------------------------------------------------------------------------
# Check for whether to enable TIMPI which can influence what we do about MPI
#---------------------------------------------------------------------------
TIMPI_CONTROL_ARGS
#--------------------------------------------------------------------------------------
# Check for whether to enable MPI and PETSc which will influence our choice of compiler
#--------------------------------------------------------------------------------------
AS_IF([test "$enable_future_timpi" = yes || test "$enable_installed_timpi" = yes],
[enable_mpi_search=yes], [enable_mpi_search=no])
ACSM_COMPILER_CONTROL_ARGS([$enable_mpi_search])
#-----------------------------------------------------------------------
# Scrape PETSc configure information for their CXX, MPI_INCLUDE, MPI_LIB
#-----------------------------------------------------------------------
ACSM_SCRAPE_PETSC_CONFIGURE
dnl------------------------------
dnl Checks for compilers
dnl------------------------------
AC_PROG_CC
METAPHYSICL_SET_CXX
dnl Added for ACSM_CODE_COVERAGE macro to work correctly, even though there's no Fortran here.
AC_PROG_FC
# --------------------------------------------------------------
# Autoconf macro for determining the proper -std=c++??
# flag, for the current compiler, for the user's requested C++
# standards level. Adds the required flag to CXXFLAGS if
# one is found. Exits if no acceptable flag is found.
# --------------------------------------------------------------
ACSM_CXX_COMPILER_STANDARD([2011], [2017])
AM_CONDITIONAL(CXX14_ENABLED,test x$HAVE_CXX14 = x1)
AM_CONDITIONAL(CXX11_ENABLED,test x$HAVE_CXX11 = x1)
dnl Get CXXFLAGS and optional flags for this compiler
ACSM_SET_CXX_FLAGS
dnl Make sure it's safe to turn on FP exceptions
ACSM_SET_FPE_SAFETY_FLAGS
dnl provide the resulting flags to our Makefiles
AC_SUBST(ACSM_CXXFLAGS_OPT)
dnl Workaround for ACSM bug
WERROR_FLAGS="$ACSM_WERROR_FLAGS"
dnl -Wall warnings, -Wall the time.
AX_CXXFLAGS_WARN_ALL
dnl More warnings, for our own testing
ACSM_ENABLE_PARANOID
dnl And those tests should fail, not just whine
ACSM_ENABLE_WERROR
dnl See if we *can* turn on FP exceptions
AC_HAVE_FEEXCEPT
LT_INIT
dnl---------------------------------------------------------
dnl Checks for library prerequisites for other libraries...
dnl---------------------------------------------------------
dnl Optional check for MASA
AX_PATH_MASA(0.20,no)
dnl Optional check for VexCL
AS_IF([test x$HAVE_CXX11 = x1],
[AX_PATH_VEXCL(0.0.0, no)],
[AM_CONDITIONAL(VEXCL_ENABLED,false)])
if (test x$HAVE_VEXCL = x1); then
antioch_optional_test_INCLUDES="$VEXCL_CPPFLAGS $antioch_optional_test_INCLUDES"
antioch_optional_test_LDFLAGS="$VEXCL_LDFLAGS $antioch_optional_test_LDFLAGS"
antioch_optional_test_LIBS="$VEXCL_LIBS $antioch_optional_test_LIBS"
fi
dnl build dependencies from right to left, so mpi before timpi
AS_IF([test "x$enablempi" = xyes],
[
ACSM_MPI
AS_IF([test "x$enablempi" = xyes],
[
AS_IF([test x"$MPI_INCLUDES" = x],,[TIMPI_CPPFLAGS="$MPI_INCLUDES $TIMPI_CPPFLAGS"])
AS_IF([test x"$MPI_LIBS" != x], [TIMPI_LIBS="$MPI_LIBS $TIMPI_LIBS"])
AS_IF([test x"$MPI_LDFLAGS" != x], [TIMPI_LIBS="$MPI_LDFLAGS $TIMPI_LIBS"])
])
])
HAVE_TIMPI=0
HAVE_TIMPI_LIB=0
AS_IF([test "$enable_installed_timpi" = yes],
[AX_PATH_TIMPI(0.0.0, yes)],
[test "$enable_future_timpi" = yes],
[
HAVE_TIMPI=1
HAVE_TIMPI_LIB=1
AC_DEFINE(HAVE_TIMPI,1,[Define if TIMPI headers are available])
AC_DEFINE(HAVE_TIMPI_LIB,1,[Define if a TIMPI library is available])
TIMPI_CPPFLAGS=""
TIMPI_LIBS="-ltimpi_$timpi_method"
],
[])
AM_CONDITIONAL(TIMPI_ENABLED,test x$HAVE_TIMPI = x1)
AM_CONDITIONAL(TIMPI_LIB_ENABLED,test x$HAVE_TIMPI_LIB = x1)
AC_SUBST(TIMPI_CPPFLAGS)
AC_SUBST(TIMPI_LIBS)
dnl--------------------------
dnl Checks for code coverage
dnl--------------------------
ACSM_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(ON)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN(metaphysicl, doxygen/metaphysicl.dox, docs/doxygen)
AC_CONFIG_FILES(doxygen/txt_common/about_vpath.page)
dnl------------------------------------------
dnl License stamping for non-dist builds
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(.)
ABS_TOP_SRC_DIR=$ac_abs_top_srcdir
AM_CONDITIONAL(METAPHYSICL_LICENSESTAMPEXISTS, [test -f $ABS_TOP_SRC_DIR/src/common/lic_utils/update_license.pl])
dnl-----------------------------------------------
dnl Generate header files
dnl-----------------------------------------------
AC_CONFIG_FILES(src/utilities/include/metaphysicl/metaphysicl_version.h)
dnl-----------------------------------------------
dnl Generate Makefiles
dnl-----------------------------------------------
AC_CONFIG_FILES([
doxygen/Makefile
doxygen/metaphysicl.dox
Makefile
metaphysicl.pc
src/Makefile
test/Makefile
])
AC_CONFIG_FILES(test/run_unit_tests.sh, [chmod +x test/run_unit_tests.sh])
# Must still call AC_OUTPUT() after generating all the files
AC_OUTPUT()
dnl------------------------------
dnl Final summary
dnl------------------------------
AX_SUMMARIZE_ENV
AX_SUMMARIZE_CONFIG