diff --git a/doc/dynare.texi b/doc/dynare.texi index bf320a1dbb60583234e0dd0c4a15857f94f4ef23..66e511a054c81da3b77990573c9814e43cb8f80a 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -372,7 +372,7 @@ In order to run Dynare, you need one of the following: @itemize @item -MATLAB version 7.0 (R14) or above; +MATLAB version 7.3 (R2006b) or above; @item GNU Octave version 3.4.0 or above. diff --git a/m4/ax_gsl.m4 b/m4/ax_gsl.m4 index 314d162d7b658d378a8d0a4f10027dbe2aec3c2a..af90668fbf51946d00f281d5a92dd4a23a5e221b 100644 --- a/m4/ax_gsl.m4 +++ b/m4/ax_gsl.m4 @@ -1,4 +1,4 @@ -dnl Detect the GSL. +dnl Detect GSL. dnl We don't use the official M4 macro since it relies on the script gsl-config, dnl which does not work when cross-compiling. dnl diff --git a/m4/ax_mexopts.m4 b/m4/ax_mexopts.m4 index 90ffac234837c78b15ff2e9da160dd028326d792..02cc204993e4bf564f9bc9c11a281dab2b88c487 100644 --- a/m4/ax_mexopts.m4 +++ b/m4/ax_mexopts.m4 @@ -22,7 +22,7 @@ AC_REQUIRE([AX_MATLAB_ARCH]) AC_REQUIRE([AX_MATLAB_VERSION]) AC_REQUIRE([AC_PROG_SED]) -AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.0], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to 7.0 (R14) at least.])]) +AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.3], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to 7.3 (R2006b) at least.])]) AC_MSG_CHECKING([for options to compile MEX for MATLAB]) @@ -52,7 +52,6 @@ case ${MATLAB_ARCH} in MATLAB_CFLAGS="-fexceptions -g -O2" MATLAB_CXXFLAGS="-g -O2" MATLAB_FFLAGS="-fexceptions -g -O2 -fno-underscoring" - AX_COMPARE_VERSION([$MATLAB_VERSION], [eq], [7.0.1], [AC_MSG_ERROR([MATLAB version 7.0.1 (R14SP1) is buggy (LAPACK library missing for MSVC), and can't be used for compiling MEX files])]) MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG" # Note that static-libstdc++ is only supported since GCC 4.5 (but generates no error on older versions) MATLAB_LDFLAGS="-static-libgcc -static-libstdc++ -shared \$(top_srcdir)/mex.def -L$MATLAB/bin/${MATLAB_ARCH}" diff --git a/m4/ax_slicot.m4 b/m4/ax_slicot.m4 new file mode 100644 index 0000000000000000000000000000000000000000..ae29245ab133f6378c174d3cdbe71ce532fbfe44 --- /dev/null +++ b/m4/ax_slicot.m4 @@ -0,0 +1,81 @@ +dnl Detect the SLICOT Library. +dnl Called with an argument of either 'matlab' or 'octave', depending +dnl on the configure script from which we're calling it +dnl +dnl AX_SLICOT([matlab]) +dnl AX_SLICOT([octave]) +dnl +dnl Copyright (C) 2012 Dynare Team +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/>. + +AC_DEFUN([AX_SLICOT], +[ + if test "x$1" != "xmatlab" && test "x$1" != "xoctave"; then + AC_MSG_ERROR([Argument to autoconf slicot macro must be either 'matlab' or 'octave']) + fi + + AC_ARG_WITH(slicot, AC_HELP_STRING([--with-slicot=DIR], [prefix to SLICOT installation]), + slicot_prefix="$withval", slicot_prefix="") + has_slicot=yes + + if test "x$slicot_prefix" != "x"; then + LDFLAGS_SLICOT="-L$withval/lib" + else + LDFLAGS_SLICOT="" + fi + ac_save_LDFLAGS="$LDFLAGS" + LDFLAGS_SAVED="$LDFLAGS" + + AC_F77_FUNC(sb02od) + + if test "x$1" = "xmatlab"; then + case ${MATLAB_ARCH} in + maci | maci64) + # Work around for exported_symbols_list flag present in Mac MATLAB_LDFLAGS + LDFLAGS="$MATLAB_LDFLAGS_NOMAP $LDFLAGS_SLICOT" + ;; + *) + LDFLAGS="$LDFLAGS $MATLAB_LDFLAGS $LDFLAGS_SLICOT" + ;; + esac + case ${MATLAB_ARCH} in + glnxa64 | win64 | maci64) + AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.8], [use_64_bit_indexing=yes], [use_64_bit_indexing=no]) + ;; + *) + use_64_bit_indexing=no + ;; + esac + + if test "$use_64_bit_indexing" = "yes"; then + AC_CHECK_LIB([slicot64_pic], [$sb02od], [LIBADD_SLICOT="-lslicot64_pic"], [has_slicot=no], [$MATLAB_LIBS]) + else + AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [has_slicot=no], [$MATLAB_LIBS]) + fi + else + LDFLAGS="$LDFLAGS $LDFLAGS_SLICOT" + AC_CHECK_LIB([slicot], [$sb02od], [LIBADD_SLICOT="-lslicot"], + [ + AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [has_slicot=no], [`$MKOCTFILE -p BLAS_LIBS` `$MKOCTFILE -p LAPACK_LIBS`]) + ], # Fallback on libslicot_pic if dynamic libslicot not found + [`$MKOCTFILE -p BLAS_LIBS` `$MKOCTFILE -p LAPACK_LIBS`]) + fi + + LDFLAGS="$ac_save_LDFLAGS" + AC_SUBST(LDFLAGS_SLICOT) + AC_SUBST(LIBADD_SLICOT) +]) diff --git a/matlab/dynare.m b/matlab/dynare.m index da761ed8209848d1f088e20af93376920d1a4c97..4945844934eb90cfdb8a2c3d389bf4a3807a8843 100644 --- a/matlab/dynare.m +++ b/matlab/dynare.m @@ -51,8 +51,8 @@ if exist('OCTAVE_VERSION') warning('This version of Dynare has only been tested on Octave 3.4.0 and above. Since your Octave version is older than that, Dynare may fail to run, or give unexpected results. Consider upgrading your Octave installation.'); end else - if matlab_ver_less_than('7.0') - warning('This version of Dynare has only been tested on MATLAB 7.0 (R14) and above. Since your MATLAB version is older than that, Dynare may fail to run, or give unexpected results. Consider upgrading your MATLAB installation, or switch to Octave.'); + if matlab_ver_less_than('7.3') + warning('This version of Dynare has only been tested on MATLAB 7.3 (R2006b) and above. Since your MATLAB version is older than that, Dynare may fail to run, or give unexpected results. Consider upgrading your MATLAB installation, or switch to Octave.'); end end @@ -101,12 +101,6 @@ for i=2:nargin command = [command ' ' varargin{i-1}]; end -% Workaround for bug in Octave 3.2 -% See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550823 -if exist('OCTAVE_VERSION') && octave_ver_less_than('3.4.0') - sleep(2) -end - [status, result] = system(command); disp(result) if status diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m index 7dc52d7b7b3f17fd521ab288b2ad9e77bd962743..ede09a40de4b4fcdf419f84a9763c90105ac22af 100644 --- a/matlab/dynare_config.m +++ b/matlab/dynare_config.m @@ -77,8 +77,8 @@ if ~exist('OCTAVE_VERSION') end end -% ordeig() was introducted in MATLAB 7.0.1, and doesn't exist in Octave -if exist('OCTAVE_VERSION') || matlab_ver_less_than('7.0.1') +% ordeig() doesn't exist in Octave +if exist('OCTAVE_VERSION') addpath([dynareroot '/missing/ordeig']) end @@ -100,12 +100,7 @@ if exist('OCTAVE_VERSION') else % Add win32 specific paths for Dynare Windows package if strcmp(computer, 'PCWIN') - if matlab_ver_less_than('7.3') - mexpath = [dynareroot '../mex/matlab/win32-7.0-7.2']; - if exist(mexpath, 'dir') - addpath(mexpath) - end - elseif matlab_ver_less_than('7.5') + if matlab_ver_less_than('7.5') mexpath = [dynareroot '../mex/matlab/win32-7.3-7.4']; if exist(mexpath, 'dir') addpath(mexpath) @@ -120,12 +115,7 @@ else % Add win64 specific paths for Dynare Windows package if strcmp(computer, 'PCWIN64') - if matlab_ver_less_than('7.3') - mexpath = [dynareroot '../mex/matlab/win64-7.2']; - if exist(mexpath, 'dir') - addpath(mexpath) - end - elseif matlab_ver_less_than('7.5') + if matlab_ver_less_than('7.5') mexpath = [dynareroot '../mex/matlab/win64-7.3-7.4']; if exist(mexpath, 'dir') addpath(mexpath) diff --git a/mex/build/kalman_steady_state.am b/mex/build/kalman_steady_state.am index 735c4576ca43b781f6be5f225e322a834d1371f1..2413e0b61f6dc308ca471d312255bc8a7ab38cee 100644 --- a/mex/build/kalman_steady_state.am +++ b/mex/build/kalman_steady_state.am @@ -1,5 +1,6 @@ noinst_PROGRAMS = kalman_steady_state kalman_steady_state_LDADD = $(LIBADD_SLICOT) +kalman_steady_state_LDFLAGS = $(LDFLAGS_SLICOT) nodist_kalman_steady_state_SOURCES = $(top_srcdir)/../../sources/kalman_steady_state/kalman_steady_state.cc diff --git a/mex/build/matlab/configure.ac b/mex/build/matlab/configure.ac index ca3011331f76790986a7062d2407c9c887694e22..025d1acfa5949d11b4f0cc9b25b20284a604fdce 100644 --- a/mex/build/matlab/configure.ac +++ b/mex/build/matlab/configure.ac @@ -83,33 +83,8 @@ AC_SUBST([LIBADD_MATIO]) AM_CONDITIONAL([HAVE_MATIO], [test "x$ac_cv_header_matio_h" = "xyes" -a "x$ac_cv_lib_matio_Mat_Open" = "xyes"]) # Check for libslicot, needed by kalman_steady_state -AC_F77_FUNC(sb02od) -LDFLAGS_SAVED=$LDFLAGS -case ${MATLAB_ARCH} in - maci | maci64) - # Work around for exported_symbols_list flag present in Mac MATLAB_LDFLAGS - LDFLAGS=$MATLAB_LDFLAGS_NOMAP - ;; - *) - LDFLAGS=$MATLAB_LDFLAGS - ;; -esac -case ${MATLAB_ARCH} in - glnxa64 | win64 | maci64) - AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.8], [use_64_bit_indexing=yes], [use_64_bit_indexing=no]) - ;; - *) - use_64_bit_indexing=no - ;; -esac -if test "$use_64_bit_indexing" = "yes"; then - AC_CHECK_LIB([slicot64_pic], [$sb02od], [LIBADD_SLICOT="-lslicot64_pic"], [], [$MATLAB_LIBS]) -else - AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [], [$MATLAB_LIBS]) -fi -LDFLAGS=$LDFLAGS_SAVED -AC_SUBST([LIBADD_SLICOT]) -AM_CONDITIONAL([HAVE_SLICOT], [test "x$LIBADD_SLICOT" != "x"]) +AX_SLICOT([matlab]) +AM_CONDITIONAL([HAVE_SLICOT], [test "x$has_slicot" = "xyes"]) AM_CONDITIONAL([DO_SOMETHING], [test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"]) @@ -129,7 +104,7 @@ else BUILD_KORDER_DYNSIMUL_MEX_MATLAB="no (missing MatIO library)" fi -if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes" -a "x$LIBADD_SLICOT" != "x"; then +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 BUILD_KALMAN_STEADY_STATE_MATLAB="yes" else BUILD_KALMAN_STEADY_STATE_MATLAB="no (missing SLICOT)" diff --git a/mex/build/octave/configure.ac b/mex/build/octave/configure.ac index 0491134c80a0f37948cddca04e2049be303839c8..cf3fc700582472c11265d2bf620b2bbd5eaf4e25 100644 --- a/mex/build/octave/configure.ac +++ b/mex/build/octave/configure.ac @@ -66,12 +66,8 @@ AC_SUBST([LIBADD_MATIO]) AM_CONDITIONAL([HAVE_MATIO], [test "x$ac_cv_header_matio_h" = "xyes" -a "x$ac_cv_lib_matio_Mat_Open" = "xyes"]) # Check for libslicot, needed by kalman_steady_state -AC_F77_FUNC(sb02od) -AC_CHECK_LIB([slicot], [$sb02od], [LIBADD_SLICOT="-lslicot"], - [AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [], [`$MKOCTFILE -p BLAS_LIBS` `$MKOCTFILE -p LAPACK_LIBS`])], # Fallback on libslicot_pic if dynamic libslicot not found - [`$MKOCTFILE -p BLAS_LIBS` `$MKOCTFILE -p LAPACK_LIBS`]) -AC_SUBST([LIBADD_SLICOT]) -AM_CONDITIONAL([HAVE_SLICOT], [test "x$LIBADD_SLICOT" != "x"]) +AX_SLICOT([octave]) +AM_CONDITIONAL([HAVE_SLICOT], [test "x$has_slicot" = "xyes"]) AM_CONDITIONAL([DO_SOMETHING], [test "x$MKOCTFILE" != "x"]) @@ -91,7 +87,7 @@ else BUILD_ESTIMATION_KORDER_DYNSIMUL_MEX_OCTAVE="no (missing MatIO library)" fi -if test "x$MKOCTFILE" != "x" -a "x$LIBADD_SLICOT" != "x"; then +if test "x$MKOCTFILE" != "x" -a "x$has_slicot" = "xyes"; then BUILD_KALMAN_STEADY_STATE_OCTAVE="yes" else BUILD_KALMAN_STEADY_STATE_OCTAVE="no (missing SLICOT)" diff --git a/windows/README.txt b/windows/README.txt index c03aed769c8e036c2ad9038210f29a50ac0f3cd7..48f6d3739c16d9978fd97e568aa1e1187fcc8b2f 100644 --- a/windows/README.txt +++ b/windows/README.txt @@ -25,8 +25,8 @@ NOTE: Dynare comes with an automated uninstaller, which you can run from the Using Dynare with MATLAB (R) ---------------------------- -Dynare requires MATLAB (R) version 7.0 or above. With older versions of MATLAB (R), -it may fail or give unexpected results. +Dynare requires MATLAB (R) version 7.3 (R2006b) or above. With older versions +of MATLAB (R), it may fail or give unexpected results. To use Dynare, you just have to add the 'matlab' subdirectory of your Dynare installation to MATLAB (R) path. You have two options for doing that: diff --git a/windows/dynare.nsi b/windows/dynare.nsi index 716a3c9893781919aa97d93a8f5694a38aeb13b2..44accbe6799afe4d29dbb8e1f67bdf819a496fe8 100644 --- a/windows/dynare.nsi +++ b/windows/dynare.nsi @@ -83,11 +83,6 @@ SectionEnd SectionGroup "MEX files for MATLAB" -Section "MEX files for MATLAB 32-bit, version 7.0 to 7.2 (R14 to R2006a)" - SetOutPath $INSTDIR\mex\matlab\win32-7.0-7.2 - File ..\mex\matlab\win32-7.0-7.2\*.dll -SectionEnd - Section "MEX files for MATLAB 32-bit, version 7.3 to 7.4 (R2006b to R2007a)" SetOutPath $INSTDIR\mex\matlab\win32-7.3-7.4 File ..\mex\matlab\win32-7.3-7.4\*.mexw32 @@ -98,11 +93,6 @@ Section "MEX files for MATLAB 32-bit, version 7.5 to 8.0 (R2007b to R2012b)" File ..\mex\matlab\win32-7.5-8.0\*.mexw32 SectionEnd -Section "MEX files for MATLAB 64-bit, version 7.2 (R2006a)" - SetOutPath $INSTDIR\mex\matlab\win64-7.2 - File ..\mex\matlab\win64-7.2\*.mexw64 -SectionEnd - Section "MEX files for MATLAB 64-bit, version 7.3 to 7.4 (R2006b to R2007a)" SetOutPath $INSTDIR\mex\matlab\win64-7.3-7.4 File ..\mex\matlab\win64-7.3-7.4\*.mexw64