source: configure.ac@ d0b958

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

configure: use meta-package information to link C tests

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

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[48b662]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
[2fad0e0]7AC_MSG_NOTICE([****************************************************************])
8AC_MSG_NOTICE([* Configuring solver VMG *])
9AC_MSG_NOTICE([****************************************************************])
[48b662]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
[336861]58AX_BOOST_SYSTEM
[48b662]59AX_BOOST_FILESYSTEM
60
61AC_SUBST([LIBVMG])
[336861]62LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)'
[48b662]63
64AC_SUBST([LIBINTERFACES])
65LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a'
66
67AC_PROG_RANLIB
68
69# Checks for libraries.
70AC_CHECK_LIB([m], [sqrt])
71
72AX_LAPACK
73AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
74
75AC_CHECK_LIB([gsl], [gsl_qrng_init])
76
77AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit],
78 [save_LIBS=$LIBS
79 LIBS="-lcppunit $LIBS"
80 AC_LINK_IFELSE([AC_LANG_SOURCE([[
81 #include <cppunit/TestResult.h>
82 int main (void)
83 {
84 CppUnit::TestResult testresult;
85 return 0;
86 }]])],
87 [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no])
88 LIBS=$save_LIBS
89 ])
90AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes])
91
92# Checks for header files.
93
94# Checks for types.
95
96# Set up FCS library arguments if inside the FCS tree.
97m4_ifdef([AX_FCS_CONFIG_SOLVER_ARGS],
98 [AX_FCS_CONFIG_SOLVER_ARGS])
99
100# Set up FCS library if inside the FCS tree.
101m4_ifdef([AX_FCS_CONFIG_SOLVER],
102 [AX_FCS_CONFIG_SOLVER
103 AC_DEFINE([vmg_float], [fcs_float],
104 [Define to the primary interface and computation floating type.])
105 AC_DEFINE([vmg_int], [fcs_int],
106 [Define to the primary integer type for particle indices.])],
107 [AC_DEFINE([vmg_float], [double],
108 [Define to the primary interface and computation floating type.])
109 AC_DEFINE([vmg_int], [int],
110 [Define to the primary integer type for particle indices.])])
111
[8e985b]112# Set up information for FCS package if inside the FCS tree.
113m4_ifdef([AX_FCS_PACKAGE_RESET],[
114AX_FCS_PACKAGE_RESET
[336861]115AX_FCS_PACKAGE_ADD([LIBS],[-lvmg $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
[d0b958]116AX_FCS_PACKAGE_ADD([LIBS_DIRS],[src])
[8e985b]117AX_FCS_PACKAGE_ADD([USE_CXXLIBS],[yes])
118])
119
[48b662]120# Checks for structures.
121
122# Checks for compiler characteristics.
123
124# Checks for library functions.
125
126# Checks for system services
127
128# we save the cache here because the tests below fail more commonly
129
130AC_CONFIG_FILES([Makefile
131 src/Makefile
132 doc/Makefile
133 test/Makefile
134 test/interfaces/Makefile
135 test/unit_test/Makefile])
136AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.