configure.ac 4.24 KB
Newer Older
1
2
dnl Process this file with autoconf to produce a configure script.

3
dnl Copyright © 2009-2019 Dynare Team
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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/>.

20
AC_PREREQ([2.62])
Stéphane Adjemian's avatar
Stéphane Adjemian committed
21
AC_INIT([dynare], [4.6-unstable])
22
AC_CONFIG_SRCDIR([configure.ac])
23
AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign])
24
25
26

AC_CHECK_PROG([MKOCTFILE], [mkoctfile], [mkoctfile])

27
28
29
30
31
32
33
34
if test -n "$MKOCTFILE"; then
  CC=$($MKOCTFILE -p CC)
  CXX=$($MKOCTFILE -p CXX)
  CFLAGS=$($MKOCTFILE -p CFLAGS)
  FFLAGS=$($MKOCTFILE -p FFLAGS)
  CXXFLAGS=$($MKOCTFILE -p CXXFLAGS)
  LDFLAGS="$($MKOCTFILE -p LFLAGS) $($MKOCTFILE -p LDFLAGS)"
  OCTAVE_VERSION=$($MKOCTFILE -v 2>&1 | sed 's/mkoctfile, version //')
35
  AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [4.2], [AC_MSG_ERROR([Your Octave is too old, please upgrade to version 4.2 at least.])])
36
37
fi

38
CFLAGS="$CFLAGS -Wall -Wno-parentheses"
39
FFLAGS="$FFLAGS -Wall"
40
CXXFLAGS="$CXXFLAGS -Wall -Wno-parentheses -Wold-style-cast"
41

42
AC_PROG_F77([gfortran g77 f77])
43
AC_PROG_CC
44
AC_PROG_CC_C99 # mjdgges DLL now uses C99 features (variable declared in for loop)
45
AC_PROG_CXX
Sébastien Villemot's avatar
Sébastien Villemot committed
46
AX_CXX_COMPILE_STDCXX_17
sebastien's avatar
sebastien committed
47
AC_PROG_RANLIB
48
AX_PROG_LN_S
49
AC_PROG_MKDIR_P
50
AM_PROG_AR
51
52
53

AX_CXX11_THREAD

54
# Check for dlopen(), needed by k_order_perturbation DLL
55
56
AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
AC_SUBST([LIBADD_DLOPEN])
57
# Check for GSL, needed by MS-SBVAR
58
AX_GSL
59
AM_CONDITIONAL([HAVE_GSL], [test "$has_gsl" = yes])
60

61
# Check for libmatio, needed by MEX files using Dynare++ code, and by ms-sbvar (the latter only under Octave, as an alternative to MATLAB's libmat)
62
AX_MATIO
63
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
64

65
# Check for libslicot, needed by kalman_steady_state
66
AX_SLICOT([octave])
67
AM_CONDITIONAL([HAVE_SLICOT], [test "$has_slicot" = yes])
68

69
# Check for UMFPACK, needed by bytecode
70
71
AC_CHECK_LIB([umfpack], [umfpack_dl_defaults], [LIBADD_UMFPACK="-lumfpack"], [AC_MSG_ERROR([Can't find UMFPACK])])
AC_SUBST([LIBADD_UMFPACK])
72

73
AM_CONDITIONAL([DO_SOMETHING], [test -n "$MKOCTFILE"])
74

75
if test -n "$MKOCTFILE"; then
76
  BUILD_MEX_OCTAVE="yes"
77
78
79
80
else
  BUILD_MEX_OCTAVE="no (missing mkoctfile)"
fi

81
if test -n "$MKOCTFILE" -a "$has_matio" = yes; then
82
  BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="yes"
83
else
84
  BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="no (missing MatIO library)"
85
86
fi

87
if  test -n "$MKOCTFILE" -a "$has_slicot" = yes; then
88
   BUILD_KALMAN_STEADY_STATE_OCTAVE="yes"
89
else
90
   BUILD_KALMAN_STEADY_STATE_OCTAVE="no (missing SLICOT)"
91
92
fi

93
if test -n "$MKOCTFILE" -a "$has_gsl" = yes -a "$has_matio" = yes; then
94
95
   BUILD_MS_SBVAR_MEX_OCTAVE="yes"
else
96
   BUILD_MS_SBVAR_MEX_OCTAVE="no (missing GSL or MatIO library)"
97
98
fi

99
100
101
102
103
AC_MSG_NOTICE([

Dynare is now configured for building the following components...

Binaries (with "make"):
104
 MEX files for Octave (except those listed below):                   $BUILD_MEX_OCTAVE
105
 Gensylv, k-order and dynare_simul MEX for Octave:                   $BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE
106
107
 MS-SBVAR MEX files for Octave:                                      $BUILD_MS_SBVAR_MEX_OCTAVE
 Kalman Steady State MEX file for Octave:                            $BUILD_KALMAN_STEADY_STATE_OCTAVE
108
109
110
111
112
113
114

])

AC_CONFIG_FILES([Makefile
                 mjdgges/Makefile
                 kronecker/Makefile
                 bytecode/Makefile
sebastien's avatar
sebastien committed
115
116
117
                 libdynare++/Makefile
                 gensylv/Makefile
                 k_order_perturbation/Makefile
118
                 dynare_simul_/Makefile
119
                 kalman_steady_state/Makefile
120
                 ms_sbvar/Makefile
121
                 block_kalman_filter/Makefile
122
		 sobol/Makefile
123
		 local_state_space_iterations/Makefile
124
125
                 perfect_foresight_problem/Makefile
                 num_procs/Makefile])
126
127

AC_OUTPUT