Build system: by default, error out if some dependency is missing

In particular, if either MATLAB or Octave is missing, one needs to pass either
--disable-matlab or --disable-octave.

Moreover, several new configure flags have been introduced for disabling some
components:
--disable-doc
--disable-dynare++
--disable-mex-dynare++
--disable-mex-ms-sbvar
--disable-mex-kalman-steady-state
time-shift
Sébastien Villemot 2019-11-26 12:58:48 +01:00
parent a909bfd58c
commit 8065e9d439
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
14 changed files with 227 additions and 247 deletions

View File

@ -66,7 +66,7 @@ pkg_source:
script:
- 'for f in configure.ac preprocessor/configure.ac mex/build/matlab/configure.ac mex/build/octave/configure.ac; do sed -i "s/^AC_INIT(\[\(.*\)\],\s*\[\(.*\)\])/AC_INIT([\1], [$VERSION])/" $f; done'
- autoreconf -si
- ./configure
- ./configure --disable-matlab --disable-octave
- make dist
artifacts:
paths:

View File

@ -1,14 +1,9 @@
SUBDIRS = preprocessor doc tests mex/sources
if HAVE_BLAS
if HAVE_LAPACK
if HAVE_MATIO
if ENABLE_DYNAREPLUSPLUS
SUBDIRS += dynare++
endif
endif
endif
# MEX must be built after dynare++ (because of kordepert)
if ENABLE_MATLAB
SUBDIRS += mex/build/matlab
endif

View File

@ -73,40 +73,114 @@ if test -z "$YACC"; then
AM_MISSING_PROG([YACC], [bison])
fi
# Check for libmatio, needed by Dynare++
AX_MATIO
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
# Define optional components and their corresponding flags and Automake conditionals
AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc], [disable compilation of documentation]), [], [enable_doc=yes])
AM_CONDITIONAL([ENABLE_DOC], [test "$enable_doc" = yes])
AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
AM_CONDITIONAL([HAVE_PDFLATEX], [test -n "$PDFLATEX"])
AC_ARG_ENABLE([dynare++], AS_HELP_STRING([--disable-dynare++], [disable compilation of Dynare++]), [], [enable_dynareplusplus=yes])
AM_CONDITIONAL([ENABLE_DYNAREPLUSPLUS], [test "$enable_dynareplusplus" = yes])
AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex])
AM_CONDITIONAL([HAVE_BIBTEX], [test -n "$BIBTEX"])
AC_ARG_ENABLE([matlab], AS_HELP_STRING([--disable-matlab], [disable compilation of MEX files for MATLAB]), [], [enable_matlab=yes])
AM_CONDITIONAL([ENABLE_MATLAB], [test "$enable_matlab" = yes])
AC_CHECK_PROG([SPHINXBUILD], [sphinx-build], [sphinx-build])
AM_CONDITIONAL([HAVE_SPHINXBUILD], [test -n "$SPHINXBUILD"])
AC_ARG_ENABLE([octave], AS_HELP_STRING([--disable-octave], [disable compilation of MEX files for Octave]), [], [enable_octave=yes])
AM_CONDITIONAL([ENABLE_OCTAVE], [test "$enable_octave" = yes])
if test -n "$PDFLATEX" -a -n "$BIBTEX"; then
AX_LATEX_CLASS([beamer], [ax_latex_have_beamer])
AC_ARG_ENABLE([org-export], AS_HELP_STRING([--enable-org-export], [enable exporting of Org files (requires Emacs, org-mode and other external programs)]))
AM_CONDITIONAL([ENABLE_ORG_EXPORT], [test -n "$enable_org_export"])
# Check utilities needed for documentation
if test "$enable_doc" = yes; then
AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex], [AC_MSG_ERROR([pdflatex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex], [AC_MSG_ERROR([bibtex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
AC_CHECK_PROG([SPHINXBUILD], [sphinx-build], [sphinx-build], [AC_MSG_ERROR([sphinx-build cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
AX_LATEX_CLASS([beamer], [ax_latex_have_beamer], [], [AC_MSG_ERROR([beamer cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
fi
AM_CONDITIONAL([HAVE_BEAMER], [test "$ax_latex_have_beamer" = yes])
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
case ${host_os} in
*darwin*)
# * OS X doesn't need to link against the Fortran libraries because
# everything is contained within the vecLib framework.
FLIBS=''
;;
esac
if test -n "$F77"; then
AX_BLAS
AX_LAPACK
# Check for BLAS, LAPACK and MATIO, needed by Dynare++
if test "$enable_dynareplusplus" = yes; then
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
case ${host_os} in
*darwin*)
# * OS X doesn't need to link against the Fortran libraries because
# everything is contained within the vecLib framework.
FLIBS=''
;;
esac
AX_BLAS
AX_LAPACK
AX_MATIO
if test "$ax_blas_ok" != yes -o "$ax_lapack_ok" != yes -o "$has_matio" != yes; then
AC_MSG_ERROR([Some dependencies of Dynare++ cannot be found. If you want to skip the compilation of Dynare++, pass the --disable-dynare++ flag.])
fi
fi
AM_CONDITIONAL([HAVE_BLAS], [test "$ax_blas_ok" = yes])
AM_CONDITIONAL([HAVE_LAPACK], [test "$ax_lapack_ok" = yes])
# Check for MATLAB
if test "$enable_matlab" = yes; then
AC_CONFIG_SUBDIRS([mex/build/matlab])
AX_MATLAB
AX_MATLAB_BATCH_OPTIONS
if test "$ax_enable_matlab" != yes; then
AC_MSG_ERROR([MATLAB cannot be found. If you want to compile Dynare without MATLAB support, pass the --disable-matlab flag.])
fi
fi
# Check for Octave
if test "$enable_octave" = yes; then
AC_CONFIG_SUBDIRS([mex/build/octave])
AC_CHECK_PROG([OCTAVE], [octave], [octave], [AC_MSG_ERROR([Octave cannot be found. If you want to compile Dynare without Octave support, pass the --disable-octave flag.])])
fi
# Construct final output message
if test "$enable_dynareplusplus" = yes; then
BUILD_DYNAREPLUSPLUS="yes"
TESTSUITE_DYNAREPLUSPLUS="yes"
else
BUILD_DYNAREPLUSPLUS="no"
TESTSUITE_DYNAREPLUSPLUS="no"
fi
if test "$enable_doc" = yes; then
BUILD_DOC="yes"
else
BUILD_DOC="no"
fi
if test -n "$enable_org_export"; then
BUILD_INTERNAL_DOC="yes"
else
BUILD_INTERNAL_DOC="no"
fi
if test "$enable_matlab" = yes; then
TESTSUITE_MATLAB="yes"
else
TESTSUITE_MATLAB="no"
fi
if test "$enable_octave" = yes; then
TESTSUITE_OCTAVE="yes"
else
TESTSUITE_OCTAVE="no"
fi
AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
Dynare++: $BUILD_DYNAREPLUSPLUS
Documentation (with "make html pdf"):
Manual and other documents $BUILD_DOC
Dynare internal doc: $BUILD_INTERNAL_DOC
Testsuites (run with "make check"):
Dynare for MATLAB: $TESTSUITE_MATLAB
Dynare for Octave: $TESTSUITE_OCTAVE
Dynare++: $TESTSUITE_DYNAREPLUSPLUS
])
AC_CONFIG_FILES([Makefile
VERSION
@ -139,93 +213,4 @@ AC_CONFIG_FILES([Makefile
mex/sources/Makefile
])
AC_ARG_ENABLE([matlab], AS_HELP_STRING([--disable-matlab], [disable compilation of MEX files for MATLAB]), [], [enable_matlab=yes])
if test "$enable_matlab" = yes; then
AC_CONFIG_SUBDIRS([mex/build/matlab])
AX_MATLAB
AX_MATLAB_BATCH_OPTIONS
fi
AM_CONDITIONAL([ENABLE_MATLAB], [test "$enable_matlab" = yes])
AM_CONDITIONAL([HAVE_MATLAB], [test "$ax_enable_matlab" = yes])
AC_ARG_ENABLE([octave], AS_HELP_STRING([--disable-octave], [disable compilation of MEX files for Octave]), [], [enable_octave=yes])
if test "$enable_octave" = yes; then
AC_CONFIG_SUBDIRS([mex/build/octave])
AC_CHECK_PROG([OCTAVE], [octave], [octave])
fi
AM_CONDITIONAL([ENABLE_OCTAVE], [test "$enable_octave" = yes])
AM_CONDITIONAL([HAVE_OCTAVE], [test "$enable_octave" = yes -a -n "$OCTAVE"])
# Enable exporting of Org files
# The clean way would be to test for Emacs, Org-mode, latex, dvipng...
AC_ARG_ENABLE([org-export], AS_HELP_STRING([--enable-org-export], [enable exporting of Org files (requires Emacs, org-mode and other external programs)]))
AM_CONDITIONAL([ENABLE_ORG_EXPORT], [test -n "$enable_org_export"])
# Construct final output message
if test "$ax_blas_ok" = yes -a "$ax_lapack_ok" = yes -a "$has_matio" = yes; then
BUILD_DYNAREPLUSPLUS="yes"
else
BUILD_DYNAREPLUSPLUS="no (missing one of: BLAS, LAPACK, MatIO)"
fi
if test -n "$PDFLATEX" -a "$ax_latex_have_beamer" = yes; then
BUILD_BEAMER_DOC="yes"
else
BUILD_BEAMER_DOC="no (missing one of: pdflatex, beamer)"
fi
if test "x$PDFLATEX" != "x"; then
BUILD_OTHER_PDF_DOC="yes"
else
BUILD_OTHER_PDF_DOC="no (missing pdflatex)"
fi
if test -n "$enable_org_export"; then
BUILD_DYNARE_INTERNAL_DOC="yes"
else
BUILD_DYNARE_INTERNAL_DOC="no (Org export not enabled)"
fi
if test -n "$SPHINXBUILD"; then
BUILD_DYNARE_HTML_MANUAL="yes"
BUILD_DYNARE_PDF_MANUAL="yes"
else
BUILD_DYNARE_HTML_MANUAL="no (missing sphinx-build)"
BUILD_DYNARE_PDF_MANUAL="no (missing sphinx-build)"
fi
if test -n "$OCTAVE"; then
TESTSUITE_OCTAVE="yes"
else
TESTSUITE_OCTAVE="no"
fi
if test "$ax_blas_ok" = yes -a "$ax_lapack_ok" = yes; then
TESTSUITE_DYNAREPLUSPLUS="yes"
else
TESTSUITE_DYNAREPLUSPLUS="no"
fi
AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
Dynare++: $BUILD_DYNAREPLUSPLUS
PDF documentation (with "make pdf"):
Dynare reference manual: $BUILD_DYNARE_PDF_MANUAL
Beamer presentations: $BUILD_BEAMER_DOC
Various other documents: $BUILD_OTHER_PDF_DOC
HTML documentation (with "make html"):
Dynare reference manual: $BUILD_DYNARE_HTML_MANUAL
Dynare internal doc: $BUILD_DYNARE_INTERNAL_DOC
Testsuites (run with "make check"):
Dynare for Octave: $TESTSUITE_OCTAVE
Dynare++: $TESTSUITE_DYNAREPLUSPLUS
])
AC_OUTPUT

View File

@ -1,20 +1,10 @@
SUBDIRS = parallel internals gsa dseries-and-reporting
if HAVE_SPHINXBUILD
if ENABLE_DOC
SUBDIRS += manual
pdf-local: guide.pdf bvar-a-la-sims.pdf dr.pdf
endif
PDF_TARGETS =
if HAVE_PDFLATEX
PDF_TARGETS += guide.pdf bvar-a-la-sims.pdf
if HAVE_BIBTEX
PDF_TARGETS += dr.pdf
endif
endif
pdf-local: $(PDF_TARGETS)
EXTRA_DIST = guide.tex guide.bbl bibmad.sty bvar-a-la-sims.tex dr.tex dr.bib dynare.plots
guide.pdf: guide.tex guide.bbl bibmad.sty

View File

@ -1,8 +1,6 @@
if HAVE_PDFLATEX
if HAVE_BEAMER
if ENABLE_DOC
pdf-local: dseriesReporting.pdf
endif
endif
SRC = dseriesReporting.tex

View File

@ -1,8 +1,6 @@
if HAVE_PDFLATEX
if HAVE_BIBTEX
if ENABLE_DOC
pdf-local: gsa.pdf
endif
endif
SRC = gsa.tex marco.bib

View File

@ -1,8 +1,6 @@
if HAVE_PDFLATEX
if HAVE_BIBTEX
if ENABLE_DOC
pdf-local: parallel.pdf
endif
endif
SRC = AvenueParadigm.pdf iVaNo_gain.pdf iVaNo_time_comp.pdf marco.bib \
netbook_complete_comp.pdf netbook_complete_openclose.pdf \

View File

@ -6,7 +6,7 @@ EXTRA_DIST = \
changelog-old.html \
changelog-sylv-old.html
if HAVE_PDFLATEX
if ENABLE_DOC
pdf-local: dynare++-ramsey.pdf dynare++-tutorial.pdf sylvester.pdf tl.pdf
endif

View File

@ -1,18 +1,17 @@
ACLOCAL_AMFLAGS = -I ../../../m4
if DO_SOMETHING
SUBDIRS = mjdgges kronecker bytecode block_kalman_filter sobol local_state_space_iterations perfect_foresight_problem num_procs
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if HAVE_MATIO
if ENABLE_MEX_DYNAREPLUSPLUS
SUBDIRS += libdynare++ gensylv k_order_perturbation dynare_simul_
endif
if HAVE_GSL
if ENABLE_MEX_MS_SBVAR
SUBDIRS += ms_sbvar
endif
if HAVE_SLICOT
if ENABLE_MEX_KALMAN_STEADY_STATE
SUBDIRS += kalman_steady_state
endif
@ -31,6 +30,5 @@ endif
install-exec-local:
$(MKDIR_P) $(DESTDIR)$(pkglibdir)/mex/matlab
endif
EXTRA_DIST = mex.def mexFunction-MacOSX.map

View File

@ -26,22 +26,17 @@ dnl The following must occur before we modify CFLAGS/CXXFLAGS
AC_CANONICAL_HOST
AX_MATLAB
AX_MATLAB_VERSION
AX_DOT_MEXEXT
AX_MATLAB_ARCH
AX_MEXOPTS
if test "$ax_enable_matlab" = yes; then
AX_MATLAB_VERSION
AX_DOT_MEXEXT
AX_MATLAB_ARCH
if test "$ax_matlab_version_ok" = yes; then
AX_MEXOPTS
AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.9], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to version 7.9 (R2009b) at least.])])
fi
CFLAGS="$MATLAB_CFLAGS"
CXXFLAGS="$MATLAB_CXXFLAGS"
FFLAGS="$MATLAB_FFLAGS"
if test "$ax_enable_matlab" != yes -o "$ax_matlab_version_ok" != yes -o "$ax_mexopts_ok" != yes; then
AC_MSG_ERROR([MATLAB cannot be found])
fi
AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.9], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to version 7.9 (R2009b) at least (or disable MATLAB support with --disable-matlab).])])
case ${host_os} in
*cygwin*)
AC_MSG_WARN([You are compiling for the Cygwin target. This means that the MEX files will])
@ -50,9 +45,9 @@ case ${host_os} in
;;
esac
CFLAGS="$CFLAGS -Wall -Wno-parentheses"
FFLAGS="$FFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall -Wno-parentheses -Wold-style-cast"
CFLAGS="$MATLAB_CFLAGS -Wall -Wno-parentheses"
FFLAGS="$MATLAB_FFLAGS -Wall"
CXXFLAGS="$MATLAB_CXXFLAGS -Wall -Wno-parentheses -Wold-style-cast"
AC_PROG_F77([gfortran g77 f77])
AC_PROG_CC
@ -82,17 +77,40 @@ AX_CXX11_THREAD
# Check for dlopen(), needed by k_order_perturbation DLL
AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
AC_SUBST([LIBADD_DLOPEN])
# Check for GSL, needed by MS-SBVAR
AX_GSL
AM_CONDITIONAL([HAVE_GSL], [test "$has_gsl" = yes])
# Define optional components and their corresponding flags and Automake conditionals
AC_ARG_ENABLE([mex-ms-sbvar], AS_HELP_STRING([--disable-mex-ms-sbvar], [disable compilation of the MS-SBVAR MEX]), [], [enable_mex_ms_sbvar=yes])
AM_CONDITIONAL([ENABLE_MEX_MS_SBVAR], [test "$enable_mex_ms_sbvar" = yes])
AC_ARG_ENABLE([mex-dynare++], AS_HELP_STRING([--disable-mex-dynare++], [disable compilation of MEX based on Dynare++]), [], [enable_mex_dynareplusplus=yes])
AM_CONDITIONAL([ENABLE_MEX_DYNAREPLUSPLUS], [test "$enable_mex_dynareplusplus" = yes])
AC_ARG_ENABLE([mex-kalman-steady-state], AS_HELP_STRING([--disable-mex-kalman-steady-state], [disable compilation of the kalman_steady_state MEX]), [], [enable_mex_kalman_steady_state=yes])
AM_CONDITIONAL([ENABLE_MEX_KALMAN_STEADY_STATE], [test "$enable_mex_kalman_steady_state" = yes])
# Check for GSL, needed by MS-SBVAR MEX
if test "$enable_mex_ms_sbvar" = yes; then
AX_GSL
if test "$has_gsl" != yes; then
AC_MSG_ERROR([GSL cannot be found. If you want to skip the compilation of the MS-SBVAR MEX, pass the --disable-mex-ms-sbvar flag.])
fi
fi
# Check for libmatio, needed by MEX files using Dynare++ code
AX_MATIO
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
if test "$enable_mex_dynareplusplus" = yes; then
AX_MATIO
if test "$has_matio" != yes; then
AC_MSG_ERROR([libmatio cannot be found. If you want to skip the compilation of MEX files based Dynare++, pass the --disable-mex-dynare++ flag.])
fi
fi
# Check for libslicot, needed by kalman_steady_state
AX_SLICOT([matlab])
AM_CONDITIONAL([HAVE_SLICOT], [test "$has_slicot" = yes])
if test "$enable_mex_kalman_steady_state" = yes; then
AX_SLICOT([matlab])
if test "$has_slicot" != yes; then
AC_MSG_ERROR([slicot cannot be found. If you want to skip the compilation of the kalman_steady_state MEX, pass the --disable-mex-kalman-steady-state flag.])
fi
fi
# On Windows, we want static linking of the external libraries
case ${host_os} in
@ -103,32 +121,7 @@ case ${host_os} in
;;
esac
AM_CONDITIONAL([DO_SOMETHING], [test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes])
if test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes; then
BUILD_MEX_MATLAB="yes"
else
BUILD_MEX_MATLAB="no (missing MATLAB, or unknown version, or unknown architecture)"
fi
if test "$ax_enable_matlab" = yes -a "$has_matio" = yes; then
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_MATLAB="yes"
else
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_MATLAB="no (missing MatIO library)"
fi
if test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes -a "$has_slicot" = yes; then
BUILD_KALMAN_STEADY_STATE_MATLAB="yes"
else
BUILD_KALMAN_STEADY_STATE_MATLAB="no (missing SLICOT)"
fi
if test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes -a "$has_gsl" = yes; then
BUILD_MS_SBVAR_MEX_MATLAB="yes"
else
BUILD_MS_SBVAR_MEX_MATLAB="no (missing GSL)"
fi
# Support for M2HTML
AC_ARG_WITH([m2html], AS_HELP_STRING([--with-m2html=DIR], [specify installation directory of M2HTML]), [
M2HTML=$withval
BUILD_M2HTML=yes
@ -139,12 +132,31 @@ BUILD_M2HTML=no
AC_SUBST([M2HTML])
AM_CONDITIONAL([HAVE_M2HTML], [test "x$M2HTML" != "x"])
# Construct final output message
if test "$enable_mex_dynareplusplus" = yes; then
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_MATLAB="yes"
else
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_MATLAB="no"
fi
if test "$enable_mex_kalman_steady_state" = yes; then
BUILD_KALMAN_STEADY_STATE_MATLAB="yes"
else
BUILD_KALMAN_STEADY_STATE_MATLAB="no"
fi
if test "$enable_mex_ms_sbvar" = yes; then
BUILD_MS_SBVAR_MEX_MATLAB="yes"
else
BUILD_MS_SBVAR_MEX_MATLAB="no"
fi
AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
MEX files for MATLAB (except those listed below): $BUILD_MEX_MATLAB
MEX files for MATLAB (except those listed below): yes
Gensylv, k-order and dynare_simul MEX files for MATLAB: $BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_MATLAB
MS-SBVAR MEX files for MATLAB: $BUILD_MS_SBVAR_MEX_MATLAB
Kalman Steady State MEX file for MATLAB: $BUILD_KALMAN_STEADY_STATE_MATLAB

View File

@ -1,24 +1,19 @@
ACLOCAL_AMFLAGS = -I ../../../m4
if DO_SOMETHING
SUBDIRS = mjdgges kronecker bytecode block_kalman_filter sobol local_state_space_iterations perfect_foresight_problem num_procs
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if HAVE_MATIO
if ENABLE_MEX_DYNAREPLUSPLUS
SUBDIRS += libdynare++ gensylv k_order_perturbation dynare_simul_
endif
if HAVE_GSL
if HAVE_MATIO
if ENABLE_MEX_MS_SBVAR
SUBDIRS += ms_sbvar
endif
endif
if HAVE_SLICOT
if ENABLE_MEX_KALMAN_STEADY_STATE
SUBDIRS += kalman_steady_state
endif
install-exec-local:
$(MKDIR_P) $(DESTDIR)$(pkglibdir)/mex/octave
endif

View File

@ -22,22 +22,17 @@ AC_INIT([dynare], [4.6-unstable])
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign])
AC_CHECK_PROG([MKOCTFILE], [mkoctfile], [mkoctfile])
AC_CHECK_PROG([MKOCTFILE], [mkoctfile], [mkoctfile], [AC_MSG_ERROR([Octave cannot be found])])
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 //')
AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [4.2], [AC_MSG_ERROR([Your Octave is too old, please upgrade to version 4.2 at least.])])
fi
CC=$($MKOCTFILE -p CC)
CXX=$($MKOCTFILE -p CXX)
CFLAGS="$($MKOCTFILE -p CFLAGS) -Wall -Wno-parentheses"
FFLAGS="$($MKOCTFILE -p FFLAGS) -Wall"
CXXFLAGS="$($MKOCTFILE -p CXXFLAGS) -Wall -Wno-parentheses -Wold-style-cast"
LDFLAGS="$($MKOCTFILE -p LFLAGS) $($MKOCTFILE -p LDFLAGS)"
CFLAGS="$CFLAGS -Wall -Wno-parentheses"
FFLAGS="$FFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall -Wno-parentheses -Wold-style-cast"
OCTAVE_VERSION=$($MKOCTFILE -v 2>&1 | sed 's/mkoctfile, version //')
AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [4.2], [AC_MSG_ERROR([Your Octave is too old, please upgrade to version 4.2 at least (or disable Octave support with --disable-octave).])])
AC_PROG_F77([gfortran g77 f77])
AC_PROG_CC
@ -54,46 +49,62 @@ AX_CXX11_THREAD
# Check for dlopen(), needed by k_order_perturbation DLL
AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
AC_SUBST([LIBADD_DLOPEN])
# Define optional components and their corresponding flags and Automake conditionals
AC_ARG_ENABLE([mex-ms-sbvar], AS_HELP_STRING([--disable-mex-ms-sbvar], [disable compilation of the MS-SBVAR MEX]), [], [enable_mex_ms_sbvar=yes])
AM_CONDITIONAL([ENABLE_MEX_MS_SBVAR], [test "$enable_mex_ms_sbvar" = yes])
AC_ARG_ENABLE([mex-dynare++], AS_HELP_STRING([--disable-mex-dynare++], [disable compilation of MEX based on Dynare++]), [], [enable_mex_dynareplusplus=yes])
AM_CONDITIONAL([ENABLE_MEX_DYNAREPLUSPLUS], [test "$enable_mex_dynareplusplus" = yes])
AC_ARG_ENABLE([mex-kalman-steady-state], AS_HELP_STRING([--disable-mex-kalman-steady-state], [disable compilation of the kalman_steady_state MEX]), [], [enable_mex_kalman_steady_state=yes])
AM_CONDITIONAL([ENABLE_MEX_KALMAN_STEADY_STATE], [test "$enable_mex_kalman_steady_state" = yes])
# Check for GSL, needed by MS-SBVAR
AX_GSL
AM_CONDITIONAL([HAVE_GSL], [test "$has_gsl" = yes])
if test "$enable_mex_ms_sbvar" = yes; then
AX_GSL
if test "$has_gsl" != yes; then
AC_MSG_ERROR([GSL cannot be found. If you want to skip the compilation of the MS-SBVAR MEX, pass the --disable-mex-ms-sbvar flag.])
fi
fi
# 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)
AX_MATIO
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
if test "$enable_mex_dynareplusplus" = yes -o "$enable_mex_ms_sbvar" = yes; then
AX_MATIO
if test "$has_matio" != yes; then
AC_MSG_ERROR([libmatio cannot be found. If you want to skip the compilation of MS-SBVAR MEX and MEX files based Dynare++, pass the --disable-mex-dynare++ and --disable-mex-ms-sbvar flags.])
fi
fi
# Check for libslicot, needed by kalman_steady_state
AX_SLICOT([octave])
AM_CONDITIONAL([HAVE_SLICOT], [test "$has_slicot" = yes])
if test "$enable_mex_kalman_steady_state" = yes; then
AX_SLICOT([octave])
if test "$has_slicot" != yes; then
AC_MSG_ERROR([slicot cannot be found. If you want to skip the compilation of the kalman_steady_state MEX, pass the --disable-mex-kalman-steady-state flag.])
fi
fi
# Check for UMFPACK, needed by bytecode
AC_CHECK_LIB([umfpack], [umfpack_dl_defaults], [LIBADD_UMFPACK="-lumfpack"], [AC_MSG_ERROR([Can't find UMFPACK])])
AC_SUBST([LIBADD_UMFPACK])
AM_CONDITIONAL([DO_SOMETHING], [test -n "$MKOCTFILE"])
if test -n "$MKOCTFILE"; then
BUILD_MEX_OCTAVE="yes"
# Construct final output message
if test "$enable_mex_dynareplusplus" = yes; then
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="yes"
else
BUILD_MEX_OCTAVE="no (missing mkoctfile)"
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="no"
fi
if test -n "$MKOCTFILE" -a "$has_matio" = yes; then
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="yes"
else
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="no (missing MatIO library)"
fi
if test -n "$MKOCTFILE" -a "$has_slicot" = yes; then
if test "$enable_mex_kalman_steady_state" = yes; then
BUILD_KALMAN_STEADY_STATE_OCTAVE="yes"
else
BUILD_KALMAN_STEADY_STATE_OCTAVE="no (missing SLICOT)"
BUILD_KALMAN_STEADY_STATE_OCTAVE="no"
fi
if test -n "$MKOCTFILE" -a "$has_gsl" = yes -a "$has_matio" = yes; then
if test "$enable_mex_ms_sbvar" = yes; then
BUILD_MS_SBVAR_MEX_OCTAVE="yes"
else
BUILD_MS_SBVAR_MEX_OCTAVE="no (missing GSL or MatIO library)"
BUILD_MS_SBVAR_MEX_OCTAVE="no"
fi
AC_MSG_NOTICE([
@ -101,7 +112,7 @@ AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
MEX files for Octave (except those listed below): $BUILD_MEX_OCTAVE
MEX files for Octave (except those listed below): yes
Gensylv, k-order and dynare_simul MEX for Octave: $BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE
MS-SBVAR MEX files for Octave: $BUILD_MS_SBVAR_MEX_OCTAVE
Kalman Steady State MEX file for Octave: $BUILD_KALMAN_STEADY_STATE_OCTAVE

@ -1 +1 @@
Subproject commit a61565bd016d5d165550a4a37849c0ebf6fdd1aa
Subproject commit 1ec3923a6b9075526a24947ae10dab25b9a0d5d4

View File

@ -881,11 +881,11 @@ EXTRA_DIST = \
deterministic_simulations/lola_data.mat
if HAVE_MATLAB
if ENABLE_MATLAB
check-local: check-matlab
endif
if HAVE_OCTAVE
if ENABLE_OCTAVE
check-local: check-octave
endif