source: configure.ac@ f57182

Last change on this file since f57182 was d13e27, checked in by Julian Iseringhausen <isering@…>, 13 years ago

vmg: Work on output verbosity.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@2845 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 7.9 KB
RevLine 
[dfed1c]1
[48b662]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
[2fad0e0]8AC_MSG_NOTICE([****************************************************************])
9AC_MSG_NOTICE([* Configuring solver VMG *])
10AC_MSG_NOTICE([****************************************************************])
[48b662]11
12AC_CONFIG_SRCDIR([src/mg.cpp])
13AC_CONFIG_AUX_DIR([build-aux])
14AC_CONFIG_MACRO_DIR([m4])
15AC_CONFIG_HEADERS([config.h])
16AM_INIT_AUTOMAKE([1.7 -Wall foreign])
17
18# We use mostly C++, but may need Fortran compiler infos for Lapack.
19AC_LANG([C++])
20
[d13e27]21# Release version switch
22AC_MSG_CHECKING(whether to enable release version)
23AC_ARG_ENABLE([release],
24 AS_HELP_STRING([--enable-release], [Compile with release settings]),
25 enable_release=$enableval,
26 enable_release="no")
27AC_MSG_RESULT($enable_release)
28AS_IF([test "$enable_release" = "yes"], [
29 AC_DEFINE([RELEASE], [1], [Release])
30 AC_DEFINE([NDEBUG], [1], [Skip asserts])
31])
32
33# One-sided communications
[0ad203]34AC_MSG_CHECKING(whether to enable one-sided MPI2 communications)
35AC_ARG_ENABLE([one_sided],
36 AS_HELP_STRING([--enable-one-sided], [Enable use of one-sided communications as according to MPI2 standard]),
37 enable_one_sided=$enableval,
[716da7]38 enable_one_sided="no")
[0ad203]39AC_MSG_RESULT($enable_one_sided)
40AS_IF([test "$enable_one_sided" = "yes"], [
41 AC_DEFINE([VMG_ONE_SIDED], [1], [Enable use of one-sided MPI2 communications])
42])
43
[d13e27]44# Interpolating B-Spline degree
45AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be in [3-6].])
46if test -z "$BSPLINE_DEG"
47then
48 BSPLINE_DEG=3
49fi
50AC_MSG_CHECKING(interpolation b-spline degree)
51AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree])
52AC_MSG_RESULT(${BSPLINE_DEG})
[5ba22b]53
[d13e27]54# Debugging switches
[cb8cc2]55AC_MSG_CHECKING(whether to enable debugging)
56AC_ARG_ENABLE([debug],
57 AS_HELP_STRING([--enable-debug], [Enable debugging]),
58 enable_debug=$enableval,
59 enable_debug="no")
[5ba22b]60AS_IF([test "x$enable_fcs_debug" != "x"],[enable_debug="yes"])
[cb8cc2]61AC_MSG_RESULT($enable_debug)
[48b662]62AS_IF([test "$enable_debug" = "yes"], [
63 CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"}
[d13e27]64 AC_DEFINE([DEBUG], [1], [Debugging])
[48b662]65])
66
[cb8cc2]67AC_MSG_CHECKING(whether to enable debug checking of matrices)
68AC_ARG_ENABLE([debug-check-matrices],
69 AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks]),
70 enable_debug_check_matrices=$enableval,
71 enable_debug_check_matrices="no")
72AC_MSG_RESULT($enable_debug_check_matrices)
[dfed1c]73AS_IF([test "$enable_debug_check_matrices" = "yes"], [
74 AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks])
75])
76
[cb8cc2]77AC_MSG_CHECKING(whether to enable MPE profiling)
78AC_ARG_ENABLE([mpe],
79 AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling]),
80 enable_mpe=$enableval,
81 enable_mpe="no")
82AC_MSG_RESULT($enable_mpe)
83
84AC_MSG_CHECKING(whether to enable MPI_Barrier debugging)
85AC_ARG_ENABLE([debug-barrier],
86 AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging]),
87 enable_debug_barrier=$enableval,
88 enable_debug_barrier="no")
89AC_MSG_RESULT($enable_debug_barrier)
[dfed1c]90AS_IF([test "$enable_debug_barrier" = "yes"], [
91 AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging])
92])
93
[d13e27]94# Several output switches
95AC_MSG_CHECKING(whether to enable info output)
96AC_ARG_ENABLE([output-info],
97 AS_HELP_STRING([--enable-output-info], [Enable info output]),
98 enable_output_info=$enableval,
99 enable_output_info="no")
100AS_IF([test "x$enable_fcs_info" != "x"],[enable_output_info="yes"])
101AC_MSG_RESULT($enable_output_info)
102AS_IF([test "$enable_output_info" = "yes"], [
103 AC_DEFINE([OUTPUT_INFO], [1], [Output level info])
[dfed1c]104])
105
[d13e27]106AC_MSG_CHECKING(whether to enable debug output)
107AC_ARG_ENABLE([output-debug],
108 AS_HELP_STRING([--enable-output-debug], [Enable debug output]),
109 enable_output_debug=$enableval,
110 enable_output_debug="no")
111AS_IF([test "x$enable_fcs_debug" != "x"],[enable_output_debug="yes"])
112AC_MSG_RESULT($enable_output_debug)
113AS_IF([test "$enable_output_debug" = "yes"], [
114 AC_DEFINE([OUTPUT_DEBUG], [1], [Output level debug])
115])
[dfed1c]116
[d13e27]117AC_MSG_CHECKING(whether to enable timing output)
118AC_ARG_ENABLE([output-timing],
119 AS_HELP_STRING([--enable-output-timing], [Enable timing output]),
120 enable_output_timing=$enableval,
121 enable_output_timing="no")
122AS_IF([test "x$enable_fcs_timing" != "x"],[enable_output_timing="yes"])
123AC_MSG_RESULT($enable_output_timing)
124AS_IF([test "$enable_output_timing" = "yes"], [
125 AC_DEFINE([OUTPUT_TIMING], [1], [Output level timing])
126])
[dfed1c]127
128
[48b662]129# Checks for programs.
130AM_MISSING_PROG([DOXYGEN], [doxygen])
131
[62f19a]132# 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).
133AX_PROG_CC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI C compiler.]))
134
[48b662]135# Do not even look for a non-MPI C++ compiler if MPICXX is set.
[dfed1c]136if test -n "$MPICXX" && test -z "$CXX"; then
137 CXX=$MPICXX
138fi
139ACX_MPI([AC_DEFINE([HAVE_MPI], [1],
140 [Define if building the MPI parallel version])
141 CXX=$MPICXX
142 LIBS="$MPILIBS $LIBS"
[ac6d04]143 AC_DEFINE([MPICH_SKIP_MPICXX], [1], [Skip C++ bindings])
144 AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])
145 AC_DEFINE([MPI_NO_CPPBIND], [1], [Skip C++ bindings])
146 AC_DEFINE([_MPICC_H], [1], [Skip C++ bindings])
147 AC_DEFINE([MPIBULL_SKIP_MPICXX], [1], [Skip C++ bindings])]
[dfed1c]148 if test "$enable_mpe" = "yes"; then
149 AC_DEFINE([HAVE_MPE], [1], [Use MPE parallel profiler])
150 fi,
151 [AC_DEFINE([sequent], [1],
152 [Define if building the serial version])])
[48b662]153
154# Get the Fortran MPI compiler, for Lapack.
155AC_LANG_PUSH([Fortran])
156# Do not even look for a non-MPI Fortran compiler if MPIFC is set.
[62f19a]157AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI Fortran compiler.]))
[48b662]158
159# Find out how to call Fortran functions from C.
160AC_FC_WRAPPERS
161AC_LANG_POP([Fortran])
162
[62f19a]163# Check for the restrict keyword.
164AC_C_RESTRICT
[48b662]165
166AM_OPTIONS_VTK
[ac6d04]167AM_PATH_VTK([5.8.0],
[48b662]168 [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
169
170AC_SUBST([VTK_CXXFLAGS])
171AC_SUBST([VTK_LDFLAGS])
[ac6d04]172AC_SUBST([VTK_LIBS])
[48b662]173
[64ba929]174AX_BOOST_BASE([1.34],[have_boost=yes],[have_boost=no])
175if test "x$have_boost" = xyes ; then
176 AX_BOOST_SYSTEM
177 AX_BOOST_FILESYSTEM
[ac6d04]178 AX_BOOST_UNIT_TEST_FRAMEWORK
[64ba929]179fi
[a40eea]180AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST], [test "x$have_boost" = xyes && test x"$ax_cv_boost_unit_test_framework" = xyes])
181AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST_LIB], [test "x$have_boost" = xyes && test x"$ax_cv_boost_unit_test_framework" = xyes && test x"$ax_cv_boost_unit_test_framework_lib" = xyes])
[48b662]182
183AC_PROG_RANLIB
[f41875]184m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
[48b662]185
186# Checks for libraries.
187AC_CHECK_LIB([m], [sqrt])
188AX_LAPACK
189AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
190
191# Checks for header files.
192
193# Checks for types.
194
[2d4211]195# Set up FCS library arguments.
196m4_ifdef([AX_FCS_CONFIG_SOLVER_ARGS],[AX_FCS_CONFIG_SOLVER_ARGS])
197
198# Set up FCS library.
199m4_ifdef([AX_FCS_CONFIG_SOLVER],[AX_FCS_CONFIG_SOLVER])
200
201# Set up FCS types
[dfed1c]202m4_ifdef([AX_FCS_TYPES],
[2d4211]203 [AC_DEFINE([vmg_float], [fcs_float],
[48b662]204 [Define to the primary interface and computation floating type.])
205 AC_DEFINE([vmg_int], [fcs_int],
206 [Define to the primary integer type for particle indices.])],
207 [AC_DEFINE([vmg_float], [double],
208 [Define to the primary interface and computation floating type.])
209 AC_DEFINE([vmg_int], [int],
210 [Define to the primary integer type for particle indices.])])
211
[8e985b]212# Set up information for FCS package if inside the FCS tree.
213m4_ifdef([AX_FCS_PACKAGE_RESET],[
214AX_FCS_PACKAGE_RESET
[e7e9a6]215AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lfcs_vmg])
216AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libfcs_vmg.a])
[e3dbbf]217AX_FCS_PACKAGE_ADD([vmg_LDADD],[$VTK_LDFLAGS $VTK_LIBS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
[c2f74f]218AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes])
[8e985b]219])
220
[48b662]221# Checks for structures.
222
223# Checks for compiler characteristics.
224
225# Checks for library functions.
226
227# Checks for system services
228
229# we save the cache here because the tests below fail more commonly
230
231AC_CONFIG_FILES([Makefile
[ac6d04]232 src/Makefile
233 doc/Makefile
[fcf7f6]234 test/Makefile])
[48b662]235AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.