2009-10-02 19:22:19 +02:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
2012-08-02 16:10:34 +02:00
|
|
|
dnl Copyright (C) 2009-2012 Dynare Team
|
2009-10-02 19:22:19 +02:00
|
|
|
dnl
|
|
|
|
dnl This file is part of Dynare.
|
|
|
|
dnl
|
|
|
|
dnl Dynare is free software: you can redistribute it and/or modify
|
|
|
|
dnl it under the terms of the GNU General Public License as published by
|
|
|
|
dnl the Free Software Foundation, either version 3 of the License, or
|
|
|
|
dnl (at your option) any later version.
|
|
|
|
dnl
|
|
|
|
dnl Dynare is distributed in the hope that it will be useful,
|
|
|
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
dnl GNU General Public License for more details.
|
|
|
|
dnl
|
|
|
|
dnl You should have received a copy of the GNU General Public License
|
|
|
|
dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2012-08-02 16:10:34 +02:00
|
|
|
AC_PREREQ([2.62])
|
2012-06-11 12:07:10 +02:00
|
|
|
AC_INIT([dynare], [4.4-unstable])
|
2009-10-02 19:22:19 +02:00
|
|
|
AC_CONFIG_SRCDIR([configure.ac])
|
2013-09-09 14:50:32 +02:00
|
|
|
AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign])
|
2009-10-02 19:22:19 +02:00
|
|
|
|
2010-01-10 11:59:02 +01:00
|
|
|
dnl The following must occur before we modify CFLAGS/CXXFLAGS
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2009-10-02 19:22:19 +02:00
|
|
|
AX_MATLAB
|
|
|
|
|
|
|
|
if test "x$ax_enable_matlab" = "xyes"; then
|
2009-12-02 14:42:25 +01:00
|
|
|
AX_MATLAB_VERSION
|
2009-10-02 19:22:19 +02:00
|
|
|
AX_DOT_MEXEXT
|
|
|
|
AX_MATLAB_ARCH
|
|
|
|
|
|
|
|
if test "x$ax_matlab_version_ok" = "xyes"; then
|
|
|
|
AX_MEXOPTS
|
|
|
|
fi
|
|
|
|
|
|
|
|
CFLAGS="$MATLAB_CFLAGS"
|
|
|
|
CXXFLAGS="$MATLAB_CXXFLAGS"
|
2010-11-18 10:11:27 +01:00
|
|
|
FFLAGS="$MATLAB_FFLAGS"
|
2009-10-02 19:22:19 +02:00
|
|
|
fi
|
|
|
|
|
2010-01-08 13:15:16 +01:00
|
|
|
case ${host_os} in
|
|
|
|
*cygwin*)
|
2010-08-18 16:21:23 +02:00
|
|
|
AC_MSG_WARN([You are compiling for the Cygwin target. This means that the MEX files will])
|
|
|
|
AC_MSG_WARN([not run from MATLAB, because it cannot load the Cygwin DLL.])
|
|
|
|
AC_MSG_WARN([This is probably not what you want. Consider using a MinGW cross-compiler.])
|
2010-01-08 13:15:16 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2011-01-13 19:05:58 +01:00
|
|
|
CFLAGS="$CFLAGS -Wall -Wno-parentheses"
|
2010-11-18 10:11:27 +01:00
|
|
|
FFLAGS="$FFLAGS -Wall"
|
2011-01-13 19:05:58 +01:00
|
|
|
CXXFLAGS="$CXXFLAGS -Wall -Wno-parentheses"
|
2010-06-11 18:40:58 +02:00
|
|
|
|
2011-02-11 16:00:15 +01:00
|
|
|
AC_PROG_F77([gfortran g77 f77])
|
2009-10-02 19:22:19 +02:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
2009-11-02 13:04:07 +01:00
|
|
|
AC_PROG_RANLIB
|
2009-10-02 19:22:19 +02:00
|
|
|
AX_PROG_LN_S
|
2010-01-29 15:13:34 +01:00
|
|
|
AC_PROG_MKDIR_P
|
2012-09-28 17:21:25 +02:00
|
|
|
AM_PROG_AR
|
2009-10-02 19:22:19 +02:00
|
|
|
AX_PTHREAD
|
2010-06-25 12:25:27 +02:00
|
|
|
# Check for boost libraries used in estimation DLL
|
|
|
|
AC_LANG_PUSH([C++])
|
2011-01-24 23:00:36 +01:00
|
|
|
AX_BOOST_BASE([1.36])
|
2010-06-25 12:25:27 +02:00
|
|
|
CPPFLAGS_SAVED="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
|
|
|
AC_CHECK_HEADER([boost/random/linear_congruential.hpp], [], [AC_MSG_ERROR([Can't find Boost Random Library])])
|
|
|
|
AC_CHECK_HEADER([boost/math/distributions/beta.hpp], [], [AC_MSG_ERROR([Can't find Boost Math Library])])
|
|
|
|
CPPFLAGS="$CPPFLAGS_SAVED"
|
|
|
|
AC_LANG_POP([C++])
|
2009-10-23 11:07:47 +02:00
|
|
|
# Check for dlopen(), needed by k_order_perturbation DLL
|
2009-10-02 19:22:19 +02:00
|
|
|
AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
|
|
|
|
AC_SUBST([LIBADD_DLOPEN])
|
2011-02-17 11:42:54 +01:00
|
|
|
# Check for GSL, needed by MS-SBVAR
|
2011-02-17 12:03:05 +01:00
|
|
|
AX_GSL
|
|
|
|
AM_CONDITIONAL([HAVE_GSL], [test "x$has_gsl" = "xyes"])
|
2009-10-02 19:22:19 +02:00
|
|
|
|
2012-08-23 18:30:27 +02:00
|
|
|
# Check for libmatio, needed by MEX files using Dynare++ code
|
2012-09-18 17:14:02 +02:00
|
|
|
AX_MATIO
|
|
|
|
AM_CONDITIONAL([HAVE_MATIO], [test "x$has_matio" = "xyes"])
|
2012-08-23 18:30:27 +02:00
|
|
|
|
2012-08-30 14:49:21 +02:00
|
|
|
# Check for libslicot, needed by kalman_steady_state
|
2012-09-18 13:18:27 +02:00
|
|
|
AX_SLICOT([matlab])
|
|
|
|
AM_CONDITIONAL([HAVE_SLICOT], [test "x$has_slicot" = "xyes"])
|
2012-08-30 14:49:21 +02:00
|
|
|
|
2009-10-02 19:22:19 +02:00
|
|
|
AM_CONDITIONAL([DO_SOMETHING], [test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"])
|
|
|
|
|
|
|
|
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"; then
|
|
|
|
if test x"$ax_pthread_ok" = "xyes"; then
|
|
|
|
BUILD_MEX_MATLAB="yes"
|
|
|
|
else
|
|
|
|
BUILD_MEX_MATLAB="yes (without POSIX threads)"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
BUILD_MEX_MATLAB="no (missing MATLAB, or unknown version, or unknown architecture)"
|
|
|
|
fi
|
|
|
|
|
2012-09-18 17:14:02 +02:00
|
|
|
if test "x$ax_enable_matlab" = "xyes" -a "x$has_matio" = "xyes"; then
|
2012-08-23 18:30:27 +02:00
|
|
|
BUILD_KORDER_DYNSIMUL_MEX_MATLAB="yes"
|
|
|
|
else
|
|
|
|
BUILD_KORDER_DYNSIMUL_MEX_MATLAB="no (missing MatIO library)"
|
|
|
|
fi
|
|
|
|
|
2012-09-18 13:18:27 +02:00
|
|
|
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes" -a "x$has_slicot" = "xyes"; then
|
2010-12-14 10:27:39 +01:00
|
|
|
BUILD_KALMAN_STEADY_STATE_MATLAB="yes"
|
2010-12-13 18:15:00 +01:00
|
|
|
else
|
2012-08-30 14:49:21 +02:00
|
|
|
BUILD_KALMAN_STEADY_STATE_MATLAB="no (missing SLICOT)"
|
2010-12-13 18:15:00 +01:00
|
|
|
fi
|
|
|
|
|
2011-02-17 11:42:54 +01:00
|
|
|
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes" -a "x$has_gsl" = "xyes"; then
|
|
|
|
BUILD_MS_SBVAR_MEX_MATLAB="yes"
|
|
|
|
else
|
|
|
|
BUILD_MS_SBVAR_MEX_MATLAB="no (missing GSL)"
|
|
|
|
fi
|
|
|
|
|
2010-09-27 15:54:54 +02:00
|
|
|
AC_ARG_ENABLE([openmp], AS_HELP_STRING([--enable-openmp], [use OpenMP for parallelization of some MEX files]), [
|
|
|
|
if test "x$enable_openmp" = "xyes"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -DUSE_OMP"
|
|
|
|
CFLAGS="$CFLAGS -fopenmp"
|
|
|
|
CXXFLAGS="$CXXFLAGS -fopenmp"
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
2010-11-08 13:08:15 +01:00
|
|
|
AC_ARG_WITH([m2html], AS_HELP_STRING([--with-m2html=DIR], [specify installation directory of M2HTML]), [
|
|
|
|
M2HTML=$withval
|
|
|
|
BUILD_M2HTML=yes
|
|
|
|
], [
|
|
|
|
M2HTML=
|
|
|
|
BUILD_M2HTML=no
|
|
|
|
])
|
|
|
|
AC_SUBST([M2HTML])
|
|
|
|
AM_CONDITIONAL([HAVE_M2HTML], [test "x$M2HTML" != "x"])
|
|
|
|
|
2009-10-02 19:22:19 +02:00
|
|
|
AC_MSG_NOTICE([
|
|
|
|
|
|
|
|
Dynare is now configured for building the following components...
|
|
|
|
|
|
|
|
Binaries (with "make"):
|
2012-08-23 18:30:27 +02:00
|
|
|
MEX files for MATLAB (except those listed below): $BUILD_MEX_MATLAB
|
|
|
|
k-order and dynare_simul MEX files for MATLAB: $BUILD_KORDER_DYNSIMUL_MEX_MATLAB
|
2011-02-17 11:42:54 +01:00
|
|
|
MS-SBVAR MEX files for MATLAB: $BUILD_MS_SBVAR_MEX_MATLAB
|
|
|
|
Kalman Steady State MEX file for MATLAB: $BUILD_KALMAN_STEADY_STATE_MATLAB
|
|
|
|
M2HTML documentation: $BUILD_M2HTML
|
2009-10-02 19:22:19 +02:00
|
|
|
|
|
|
|
])
|
|
|
|
|
2010-06-01 15:33:45 +02:00
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
mjdgges/Makefile
|
|
|
|
kronecker/Makefile
|
|
|
|
bytecode/Makefile
|
2011-01-25 23:13:00 +01:00
|
|
|
libdynare++/Makefile
|
|
|
|
gensylv/Makefile
|
2010-06-01 15:33:45 +02:00
|
|
|
k_order_perturbation/Makefile
|
|
|
|
dynare_simul_/Makefile
|
2011-01-25 23:13:00 +01:00
|
|
|
estimation/Makefile
|
2011-02-17 11:42:54 +01:00
|
|
|
kalman_steady_state/Makefile
|
2011-09-23 18:22:15 +02:00
|
|
|
ms_sbvar/Makefile
|
2011-12-21 18:23:15 +01:00
|
|
|
block_kalman_filter/Makefile
|
2012-02-28 08:43:28 +01:00
|
|
|
sobol/Makefile
|
|
|
|
local_state_space_iterations/Makefile])
|
2010-06-01 15:33:45 +02:00
|
|
|
|
2009-10-02 19:22:19 +02:00
|
|
|
AC_OUTPUT
|