source: configure.ac@ 64ba929

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

configure: fix --with-boost=no

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

  • Property mode set to 100644
File size: 5.7 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],[have_boost=yes],[have_boost=no])
112if test "x$have_boost" = xyes ; then
113 AX_BOOST_SYSTEM
114 AX_BOOST_FILESYSTEM
115fi
116
117AC_SUBST([LIBVMG])
118LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)'
119
120AC_SUBST([LIBINTERFACES])
121LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a'
122
123AC_PROG_RANLIB
124
125# Checks for libraries.
126AC_CHECK_LIB([m], [sqrt])
127AX_LAPACK
128AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
129
130AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit],
131 [save_LIBS=$LIBS
132 LIBS="-lcppunit $LIBS"
133 AC_LINK_IFELSE([AC_LANG_SOURCE([[
134 #include <cppunit/TestResult.h>
135 int main (void)
136 {
137 CppUnit::TestResult testresult;
138 return 0;
139 }]])],
140 [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no])
141 LIBS=$save_LIBS
142 ])
143AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes])
144
145# Checks for header files.
146
147# Checks for types.
148
149# Set up FCS types if inside the FCS tree.
150m4_ifdef([AX_FCS_TYPES],
151 [AX_FCS_TYPES
152 AC_DEFINE([vmg_float], [fcs_float],
153 [Define to the primary interface and computation floating type.])
154 AC_DEFINE([vmg_int], [fcs_int],
155 [Define to the primary integer type for particle indices.])],
156 [AC_DEFINE([vmg_float], [double],
157 [Define to the primary interface and computation floating type.])
158 AC_DEFINE([vmg_int], [int],
159 [Define to the primary integer type for particle indices.])])
160
161# Set up information for FCS package if inside the FCS tree.
162m4_ifdef([AX_FCS_PACKAGE_RESET],[
163AX_FCS_PACKAGE_RESET
164AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lvmg])
165AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libvmg.a])
166AX_FCS_PACKAGE_ADD([vmg_LDADD],[$BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
167AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes])
168])
169
170# Checks for structures.
171
172# Checks for compiler characteristics.
173
174# Checks for library functions.
175
176# Checks for system services
177
178# we save the cache here because the tests below fail more commonly
179
180AC_CONFIG_FILES([Makefile
181 src/Makefile
182 doc/Makefile
183 test/Makefile
184 test/interfaces/Makefile
185 test/unit_test/Makefile
186 vmg_particles/Makefile])
187AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.