source: configure.ac@ fab30d

Last change on this file since fab30d was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

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

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