source: configure.ac@ e7e9a6

Last change on this file since e7e9a6 was e7e9a6, checked in by Michael Hofmann <michael.hofmann@…>, 14 years ago

rename all solver method libraries to libfcs_...

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

  • Property mode set to 100644
File size: 7.3 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([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
21# switch for one-sided communications
22AC_MSG_CHECKING(whether to enable one-sided MPI2 communications)
23AC_ARG_ENABLE([one_sided],
24 AS_HELP_STRING([--enable-one-sided], [Enable use of one-sided communications as according to MPI2 standard]),
25 enable_one_sided=$enableval,
26 enable_one_sided="yes")
27AC_MSG_RESULT($enable_one_sided)
28AS_IF([test "$enable_one_sided" = "yes"], [
29 AC_DEFINE([VMG_ONE_SIDED], [1], [Enable use of one-sided MPI2 communications])
30])
31
32# several debug output switches
33AC_MSG_CHECKING(whether to enable debugging)
34AC_ARG_ENABLE([debug],
35 AS_HELP_STRING([--enable-debug], [Enable debugging]),
36 enable_debug=$enableval,
37 enable_debug="no")
38AC_MSG_RESULT($enable_debug)
39AS_IF([test "$enable_debug" = "yes"], [
40 CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"}
41 AC_DEFINE([DEBUG], [1], [Debugging output])
42])
43
44AC_MSG_CHECKING(whether to enable debug checking of matrices)
45AC_ARG_ENABLE([debug-check-matrices],
46 AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks]),
47 enable_debug_check_matrices=$enableval,
48 enable_debug_check_matrices="no")
49AC_MSG_RESULT($enable_debug_check_matrices)
50AS_IF([test "$enable_debug_check_matrices" = "yes"], [
51 AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks])
52])
53
54AC_MSG_CHECKING(whether to enable debug output)
55AC_ARG_ENABLE([debug-output],
56 AS_HELP_STRING([--enable-debug-output], [Enable debugging output]),
57 enable_debug_output=$enableval,
58 enable_debug_output="no")
59AC_MSG_RESULT($enable_debug_output)
60AS_IF([test "$enable_debug_output" = "yes"], [
61 AC_DEFINE([DEBUG_OUTPUT], [1], [Debugging output])
62])
63
64AC_MSG_CHECKING(whether to enable MPE profiling)
65AC_ARG_ENABLE([mpe],
66 AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling]),
67 enable_mpe=$enableval,
68 enable_mpe="no")
69AC_MSG_RESULT($enable_mpe)
70
71AC_MSG_CHECKING(whether to enable debug measurement of run times)
72AC_ARG_ENABLE([debug-measure-time],
73 AS_HELP_STRING([--enable-debug-measure-time], [Enable runtime measurement]),
74 enable_debug_measure_time=$enableval,
75 enable_debug_measure_time="no")
76AC_MSG_RESULT($enable_debug_measure_time)
77AS_IF([test "$enable_debug_measure_time" = "yes"], [
78 AC_DEFINE([DEBUG_MEASURE_TIME], [1], [Runtime measurement])
79])
80
81AC_MSG_CHECKING(whether to enable MPI_Barrier debugging)
82AC_ARG_ENABLE([debug-barrier],
83 AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging]),
84 enable_debug_barrier=$enableval,
85 enable_debug_barrier="no")
86AC_MSG_RESULT($enable_debug_barrier)
87AS_IF([test "$enable_debug_barrier" = "yes"], [
88 AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging])
89])
90
91AC_MSG_CHECKING(whether to enable release version)
92AC_ARG_ENABLE([release],
93 AS_HELP_STRING([--enable-release], [Compile with release settings]),
94 enable_release=$enableval,
95 enable_release="no")
96AC_MSG_RESULT($enable_release)
97AS_IF([test "$enable_release" = "yes"], [
98 AC_DEFINE([RELEASE], [1], [Release]),
99 AC_DEFINE([NDEBUG], [1], [Skip asserts])
100])
101
102AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be [3-6].])
103
104if test -z "$BSPLINE_DEG"
105then
106 BSPLINE_DEG=3
107fi
108
109AC_MSG_CHECKING(interpolation b-spline degree)
110AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree])
111AC_MSG_RESULT(${BSPLINE_DEG})
112
113# Checks for programs.
114AM_MISSING_PROG([DOXYGEN], [doxygen])
115
116# 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).
117AX_PROG_CC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI C compiler.]))
118
119# Do not even look for a non-MPI C++ compiler if MPICXX is set.
120if test -n "$MPICXX" && test -z "$CXX"; then
121 CXX=$MPICXX
122fi
123ACX_MPI([AC_DEFINE([HAVE_MPI], [1],
124 [Define if building the MPI parallel version])
125 CXX=$MPICXX
126 LIBS="$MPILIBS $LIBS"
127 AC_DEFINE([MPICH_SKIP_CXX], [1], [Skip C++ bindings])
128 AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])]
129 if test "$enable_mpe" = "yes"; then
130 AC_DEFINE([HAVE_MPE], [1], [Use MPE parallel profiler])
131 fi,
132 [AC_DEFINE([sequent], [1],
133 [Define if building the serial version])])
134
135# Get the Fortran MPI compiler, for Lapack.
136AC_LANG_PUSH([Fortran])
137# Do not even look for a non-MPI Fortran compiler if MPIFC is set.
138AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI Fortran compiler.]))
139
140# Find out how to call Fortran functions from C.
141AC_FC_WRAPPERS
142AC_LANG_POP([Fortran])
143
144# Check for the restrict keyword.
145AC_C_RESTRICT
146
147AM_OPTIONS_VTK
148AM_PATH_VTK([5.4.2],
149 [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
150
151AC_SUBST([VTK_CXXFLAGS])
152AC_SUBST([VTK_LDFLAGS])
153
154AX_BOOST_BASE([1.34],[have_boost=yes],[have_boost=no])
155if test "x$have_boost" = xyes ; then
156 AX_BOOST_SYSTEM
157 AX_BOOST_FILESYSTEM
158fi
159
160AC_SUBST([LIBVMG])
161LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)'
162
163AC_SUBST([LIBINTERFACES])
164LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a'
165
166AC_PROG_RANLIB
167
168# Checks for libraries.
169AC_CHECK_LIB([m], [sqrt])
170AX_LAPACK
171AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
172
173AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit],
174 [save_LIBS=$LIBS
175 LIBS="-lcppunit $LIBS"
176 AC_LINK_IFELSE([AC_LANG_SOURCE([[
177 #include <cppunit/TestResult.h>
178 int main (void)
179 {
180 CppUnit::TestResult testresult;
181 return 0;
182 }]])],
183 [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no])
184 LIBS=$save_LIBS
185 ])
186AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes])
187
188# Checks for header files.
189
190# Checks for types.
191
192# Set up FCS types if inside the FCS tree.
193m4_ifdef([AX_FCS_TYPES],
194 [AX_FCS_TYPES
195 AC_DEFINE([vmg_float], [fcs_float],
196 [Define to the primary interface and computation floating type.])
197 AC_DEFINE([vmg_int], [fcs_int],
198 [Define to the primary integer type for particle indices.])],
199 [AC_DEFINE([vmg_float], [double],
200 [Define to the primary interface and computation floating type.])
201 AC_DEFINE([vmg_int], [int],
202 [Define to the primary integer type for particle indices.])])
203
204# Set up information for FCS package if inside the FCS tree.
205m4_ifdef([AX_FCS_PACKAGE_RESET],[
206AX_FCS_PACKAGE_RESET
207AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lfcs_vmg])
208AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libfcs_vmg.a])
209AX_FCS_PACKAGE_ADD([vmg_LDADD],[$BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
210AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes])
211])
212
213# Checks for structures.
214
215# Checks for compiler characteristics.
216
217# Checks for library functions.
218
219# Checks for system services
220
221# we save the cache here because the tests below fail more commonly
222
223AC_CONFIG_FILES([Makefile
224 src/Makefile
225 doc/Makefile
226 test/Makefile
227 test/interfaces/Makefile
228 test/unit_test/Makefile
229 vmg_particles/Makefile])
230AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.