source: configure.ac@ c2f74f

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

configure: rewrite meta-package

  1. handle all solvers (with and without sub-configures) the same way
  2. put -lfcs4fortran before -lfcs
  3. don't set ..._LIBS variables in AX_LIB_FFTW3 if the libraries are missing

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

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