source: configure.ac@ 8e985b

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

configure: support meta-package in VMG and add Fortran and C++ library support.

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

  • Property mode set to 100644
File size: 3.8 KB
Line 
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.60])
5AC_INIT([VMG], [0.1], [tremolo-devel@ins.uni-bonn.de])
6
7AC_MSG_NOTICE([****************************************************************])
8AC_MSG_NOTICE([* Configuring solver VMG *])
9AC_MSG_NOTICE([****************************************************************])
10
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 AC_DEFINE([DEBUGCMAT], [1], [Check matrices for nan])
27])
28
29# Checks for programs.
30AM_MISSING_PROG([DOXYGEN], [doxygen])
31
32# Do not even look for a non-MPI C++ compiler if MPICXX is set.
33AX_PROG_CXX_MPI(,[AC_DEFINE([HAVE_MPI], [1],
34 [Define if building the MPI parallel version])
35 AC_DEFINE([MPICH_SKIP_CXX], [1], [Skip C++ bindings])
36 AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])],
37 [AC_DEFINE([sequent], [1],
38 [Define if building the serial version])])
39
40# Get the Fortran MPI compiler, for Lapack.
41AC_LANG_PUSH([Fortran])
42# Do not even look for a non-MPI Fortran compiler if MPIFC is set.
43AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The PP3MG solver requires an MPI Fortran compiler.]))
44
45# Find out how to call Fortran functions from C.
46AC_FC_WRAPPERS
47AC_LANG_POP([Fortran])
48
49
50AM_OPTIONS_VTK
51AM_PATH_VTK([5.4.2],
52 [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
53
54AC_SUBST([VTK_CXXFLAGS])
55AC_SUBST([VTK_LDFLAGS])
56
57AX_BOOST_BASE
58AX_BOOST_FILESYSTEM
59
60AC_SUBST([LIBVMG])
61LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_FILESYSTEM_LIB)'
62
63AC_SUBST([LIBINTERFACES])
64LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a'
65
66AC_PROG_RANLIB
67
68# Checks for libraries.
69AC_CHECK_LIB([m], [sqrt])
70
71AX_LAPACK
72AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
73
74AC_CHECK_LIB([gsl], [gsl_qrng_init])
75
76AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit],
77 [save_LIBS=$LIBS
78 LIBS="-lcppunit $LIBS"
79 AC_LINK_IFELSE([AC_LANG_SOURCE([[
80 #include <cppunit/TestResult.h>
81 int main (void)
82 {
83 CppUnit::TestResult testresult;
84 return 0;
85 }]])],
86 [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no])
87 LIBS=$save_LIBS
88 ])
89AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes])
90
91# Checks for header files.
92
93# Checks for types.
94
95# Set up FCS library arguments if inside the FCS tree.
96m4_ifdef([AX_FCS_CONFIG_SOLVER_ARGS],
97 [AX_FCS_CONFIG_SOLVER_ARGS])
98
99# Set up FCS library if inside the FCS tree.
100m4_ifdef([AX_FCS_CONFIG_SOLVER],
101 [AX_FCS_CONFIG_SOLVER
102 AC_DEFINE([vmg_float], [fcs_float],
103 [Define to the primary interface and computation floating type.])
104 AC_DEFINE([vmg_int], [fcs_int],
105 [Define to the primary integer type for particle indices.])],
106 [AC_DEFINE([vmg_float], [double],
107 [Define to the primary interface and computation floating type.])
108 AC_DEFINE([vmg_int], [int],
109 [Define to the primary integer type for particle indices.])])
110
111# Set up information for FCS package if inside the FCS tree.
112m4_ifdef([AX_FCS_PACKAGE_RESET],[
113AX_FCS_PACKAGE_RESET
114AX_FCS_PACKAGE_ADD([LIBS],[$BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
115AX_FCS_PACKAGE_ADD([USE_CXXLIBS],[yes])
116])
117
118# Checks for structures.
119
120# Checks for compiler characteristics.
121
122# Checks for library functions.
123
124# Checks for system services
125
126# we save the cache here because the tests below fail more commonly
127
128AC_CONFIG_FILES([Makefile
129 src/Makefile
130 doc/Makefile
131 test/Makefile
132 test/interfaces/Makefile
133 test/unit_test/Makefile])
134AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.