source: ThirdParty/vmg/configure.ac

Candidate_v1.6.1
Last change on this file was ac9dc8, checked in by Frederik Heber <frederik.heber@…>, 8 years ago

FIX: LT_INIT came too late for boost in ThirdParty's vmg.

  • Property mode set to 100644
File size: 8.5 KB
Line 
1
2# -*- Autoconf -*-
3# Process this file with autoconf to produce a configure script.
4
5AC_PREREQ([2.60])
6AC_INIT([VMG], [0.1], [tremolo-devel@ins.uni-bonn.de])
7
8AC_MSG_NOTICE([****************************************************************])
9AC_MSG_NOTICE([* Configuring solver VMG *])
10AC_MSG_NOTICE([****************************************************************])
11
12AC_CONFIG_SRCDIR([src/mg.cpp])
13AC_CONFIG_AUX_DIR([build-aux])
14AC_CONFIG_MACRO_DIR([m4])
15AC_CONFIG_HEADERS([libvmg_config.h])
16AM_INIT_AUTOMAKE([1.7 dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects])
17
18# We use mostly C++, but may need Fortran compiler infos for Lapack.
19AC_LANG([C++])
20
21# use libtool
22LT_INIT([static])
23
24# Release version switch
25AC_MSG_CHECKING(whether to enable debug version)
26AC_ARG_ENABLE([debug],
27 AS_HELP_STRING([--enable-debug], [Compile with debug settings]),
28 enable_debug=$enableval,
29 enable_debug="no")
30AC_MSG_RESULT($enable_debug)
31AS_IF([test "$enable_debug" = "no"], [
32 AC_DEFINE([RELEASE], [1], [Release])
33 AC_DEFINE([NDEBUG], [1], [Skip asserts])
34])
35
36# One-sided communications
37AC_MSG_CHECKING(whether to enable one-sided MPI2 communications)
38AC_ARG_ENABLE([one_sided],
39 AS_HELP_STRING([--enable-one-sided], [Enable use of one-sided communications as according to MPI2 standard]),
40 enable_one_sided=$enableval,
41 enable_one_sided="no")
42AC_MSG_RESULT($enable_one_sided)
43AS_IF([test "$enable_one_sided" = "yes"], [
44 AC_DEFINE([VMG_ONE_SIDED], [1], [Enable use of one-sided MPI2 communications])
45])
46
47# Interpolating B-Spline degree
48AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be in [3-6].])
49if test -z "$BSPLINE_DEG"
50then
51 BSPLINE_DEG=3
52fi
53AC_MSG_CHECKING(interpolation b-spline degree)
54AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree])
55AC_MSG_RESULT(${BSPLINE_DEG})
56
57# Debugging switches
58AC_MSG_CHECKING(whether to enable debugging)
59AC_ARG_ENABLE([debug],
60 AS_HELP_STRING([--enable-debug], [Enable debugging]),
61 enable_debug=$enableval,
62 enable_debug="no")
63AS_IF([test "x$enable_fcs_debug" != "x"],[enable_debug="yes"])
64AC_MSG_RESULT($enable_debug)
65AS_IF([test "$enable_debug" = "yes"], [
66 CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"}
67 AC_DEFINE([DEBUG], [1], [Debugging])
68])
69
70AC_MSG_CHECKING(whether to enable debug checking of matrices)
71AC_ARG_ENABLE([debug-check-matrices],
72 AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks]),
73 enable_debug_check_matrices=$enableval,
74 enable_debug_check_matrices="no")
75AC_MSG_RESULT($enable_debug_check_matrices)
76AS_IF([test "$enable_debug_check_matrices" = "yes"], [
77 AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks])
78])
79
80AC_MSG_CHECKING(whether to enable MPE profiling)
81AC_ARG_ENABLE([mpe],
82 AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling]),
83 enable_mpe=$enableval,
84 enable_mpe="no")
85AC_MSG_RESULT($enable_mpe)
86
87AC_MSG_CHECKING(whether to enable MPI_Barrier debugging)
88AC_ARG_ENABLE([debug-barrier],
89 AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging]),
90 enable_debug_barrier=$enableval,
91 enable_debug_barrier="no")
92AC_MSG_RESULT($enable_debug_barrier)
93AS_IF([test "$enable_debug_barrier" = "yes"], [
94 AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging])
95])
96
97# Several output switches
98AC_MSG_CHECKING(whether to enable info output)
99AC_ARG_ENABLE([output-info],
100 AS_HELP_STRING([--enable-output-info], [Enable info output]),
101 enable_output_info=$enableval,
102 enable_output_info="no")
103AS_IF([test "x$enable_fcs_info" != "x"],[enable_output_info="yes"])
104AC_MSG_RESULT($enable_output_info)
105AS_IF([test "$enable_output_info" = "yes"], [
106 AC_DEFINE([OUTPUT_INFO], [1], [Output level info])
107])
108
109AC_MSG_CHECKING(whether to enable debug output)
110AC_ARG_ENABLE([output-debug],
111 AS_HELP_STRING([--enable-output-debug], [Enable debug output]),
112 enable_output_debug=$enableval,
113 enable_output_debug="no")
114AS_IF([test "x$enable_fcs_debug" != "x"],[enable_output_debug="yes"])
115AC_MSG_RESULT($enable_output_debug)
116AS_IF([test "$enable_output_debug" = "yes"], [
117 AC_DEFINE([OUTPUT_DEBUG], [1], [Output level debug])
118])
119
120AC_MSG_CHECKING(whether to enable timing output)
121AC_ARG_ENABLE([output-timing],
122 AS_HELP_STRING([--enable-output-timing], [Enable timing output]),
123 enable_output_timing=$enableval,
124 enable_output_timing="no")
125AS_IF([test "x$enable_fcs_timing" != "x"],[enable_output_timing="yes"])
126AC_MSG_RESULT($enable_output_timing)
127AS_IF([test "$enable_output_timing" = "yes"], [
128 AC_DEFINE([OUTPUT_TIMING], [1], [Output level timing])
129])
130
131
132# Checks for programs.
133AM_MISSING_PROG([DOXYGEN], [doxygen])
134
135# Get the C MPI compiler, because the following AC_FC_WRAPPERS macro works better if CC is from the same "family" as FC (which is MPI).
136AX_PROG_CC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI C compiler.]))
137
138# Do not even look for a non-MPI C++ compiler if MPICXX is set.
139if test -n "$MPICXX" && test -z "$CXX"; then
140 CXX=$MPICXX
141fi
142ACX_MPI([AC_DEFINE([HAVE_MPI], [1],
143 [Define if building the MPI parallel version])
144 CXX=$MPICXX
145 LIBS="$MPILIBS $LIBS"
146 AC_DEFINE([MPICH_SKIP_MPICXX], [1], [Skip C++ bindings])
147 AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])
148 AC_DEFINE([MPI_NO_CPPBIND], [1], [Skip C++ bindings])
149 AC_DEFINE([_MPICC_H], [1], [Skip C++ bindings])
150 AC_DEFINE([MPIBULL_SKIP_MPICXX], [1], [Skip C++ bindings])]
151 if test "$enable_mpe" = "yes"; then
152 AC_DEFINE([HAVE_MPE], [1], [Use MPE parallel profiler])
153 fi,
154 [AC_DEFINE([sequent], [1],
155 [Define if building the serial version])])
156
157# Get the Fortran MPI compiler, for Lapack.
158AC_LANG_PUSH([Fortran])
159# Do not even look for a non-MPI Fortran compiler if MPIFC is set.
160AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI Fortran compiler.]))
161
162# Find out how to call Fortran functions from C.
163AC_FC_WRAPPERS
164AC_LANG_POP([Fortran])
165
166# Check for the restrict keyword.
167AC_C_RESTRICT
168
169AM_OPTIONS_VTK
170AM_PATH_VTK([5.8.0],
171 [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
172
173AC_SUBST([VTK_CXXFLAGS])
174AC_SUBST([VTK_LDFLAGS])
175AC_SUBST([VTK_LIBS])
176
177# Boost
178BOOST_REQUIRE([1.34])
179
180# Boost headers with libraries
181BOOST_SYSTEM
182BOOST_FILESYSTEM
183BOOST_TEST
184
185AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST], [test x"$boost_cv_lib_unit_test_framework" = xyes])
186AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST_LIB], [test x"$boost_cv_lib_unit_test_framework" = xyes])
187
188# use libtool
189LT_INIT([static])
190AC_SUBST([LIBTOOL_DEPS])
191
192dnl superceded by libtool
193dnl AC_PROG_RANLIB
194dnl 4_ifdef([AM_PROG_AR], [AM_PROG_AR])
195
196# Define these substitions here to keep all version information in one place.
197# For information on how to properly maintain the library version information,
198# refer to the libtool manual, section "Updating library version information":
199# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
200AC_SUBST([VMG_SO_VERSION], [1:0:0])
201AC_SUBST([VMG_API_VERSION], [1.0.0])
202
203# Checks for libraries.
204AC_CHECK_LIB([m], [sqrt])
205AX_LAPACK
206AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
207
208# Checks for header files.
209
210# Checks for types.
211
212# Set up FCS library arguments.
213m4_ifdef([AX_FCS_CONFIG_SOLVER_ARGS],[AX_FCS_CONFIG_SOLVER_ARGS])
214
215# Set up FCS library.
216m4_ifdef([AX_FCS_CONFIG_SOLVER],[AX_FCS_CONFIG_SOLVER])
217
218# Set up FCS types
219m4_ifdef([AX_FCS_TYPES],
220 [AC_DEFINE([vmg_float], [fcs_float],
221 [Define to the primary interface and computation floating type.])
222 AC_DEFINE([vmg_int], [fcs_int],
223 [Define to the primary integer type for particle indices.])],
224 [AC_DEFINE([vmg_float], [double],
225 [Define to the primary interface and computation floating type.])
226 AC_DEFINE([vmg_int], [int],
227 [Define to the primary integer type for particle indices.])])
228
229# Set up information for FCS package if inside the FCS tree.
230have_fcs="no"
231m4_ifdef([AX_FCS_PACKAGE_RESET],[
232AX_FCS_PACKAGE_RESET
233AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lfcs_vmg])
234AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libfcs_vmg.a])
235AX_FCS_PACKAGE_ADD([vmg_LDADD],[$VTK_LDFLAGS $VTK_LIBS $BOOST_SYSTEM_LDFLAGS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LDFLAGS $BOOST_FILESYSTEM_LIBS $LAPACK_LIBS $BLAS_LIBS])
236AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes])
237have_fsc="yes"
238])
239AM_CONDITIONAL(COND_HAVE_FCS, [test x"have_fcs" = xyes])
240
241# Checks for structures.
242
243# Checks for compiler characteristics.
244
245# Checks for library functions.
246
247# Checks for system services
248
249# we save the cache here because the tests below fail more commonly
250
251# package information
252AC_CONFIG_FILES([
253 VMG.pc:VMG.pc.in])
254
255AC_CONFIG_FILES([Makefile
256 src/Makefile
257 doc/Makefile
258 test/Makefile])
259
260AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.