diff --git a/doc/dynare.texi b/doc/dynare.texi index bb2171d1e2764c3b9a93924da49d7c18ee8589f9..b8bf6f752a1312f568562336b90f1df5a9675e8c 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -432,7 +432,7 @@ In order to run Dynare, you need one of the following: @itemize @item -MATLAB version 7.3 (R2006b) or above; +MATLAB version 7.5 (R2007b) or above; @item GNU Octave version 3.6 or above. diff --git a/m4/ax_mexopts.m4 b/m4/ax_mexopts.m4 index 1417c79389abfb3c4375fc2735e64030ffee0b55..c245e2511a3ae19a55203ccc901bb87b52622f98 100644 --- a/m4/ax_mexopts.m4 +++ b/m4/ax_mexopts.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2009-2012 Dynare Team +dnl Copyright (C) 2009-2014 Dynare Team dnl dnl This file is part of Dynare. dnl @@ -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.3], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to 7.3 (R2006b) at least.])]) +AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.5], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to 7.5 (R2007b) at least.])]) AC_MSG_CHECKING([for options to compile MEX for MATLAB]) @@ -36,9 +36,7 @@ case ${MATLAB_ARCH} in MATLAB_FFLAGS="-fPIC -g -O2 -fexceptions" MATLAB_LDFLAGS_NOMAP="-shared -Wl,--no-undefined -Wl,-rpath-link,$MATLAB/bin/${MATLAB_ARCH} -L$MATLAB/bin/${MATLAB_ARCH}" MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,--version-script,$MATLAB/extern/lib/${MATLAB_ARCH}/mexFunction.map" - MATLAB_LIBS="-lmx -lmex -lmat -lm -lstdc++ -lmwlapack" - # Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries - AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} -lmwblas"]) + MATLAB_LIBS="-lmx -lmex -lmat -lm -lstdc++ -lmwlapack -lmwblas" if test "${MATLAB_ARCH}" = "glnx86"; then MATLAB_DEFS="$MATLAB_DEFS -D_FILE_OFFSET_BITS=64" MATLAB_CFLAGS="$MATLAB_CFLAGS -m32" @@ -57,9 +55,7 @@ case ${MATLAB_ARCH} in # Note that static-libstdc++ is only supported since GCC 4.5 (but generates no error on older versions) MATLAB_LDFLAGS_NOMAP="-static-libgcc -static-libstdc++ -shared -L$MATLAB/bin/${MATLAB_ARCH}" MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP $(pwd)/$srcdir/mex.def" - MATLAB_LIBS="-lmex -lmx -lmat -lmwlapack" - # Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries - AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} -lmwblas"]) + MATLAB_LIBS="-lmex -lmx -lmat -lmwlapack -lmwblas" ax_mexopts_ok="yes" ;; maci | maci64) @@ -75,9 +71,7 @@ case ${MATLAB_ARCH} in MATLAB_FFLAGS="-fexceptions -fbackslash -arch $ARCHS" MATLAB_LDFLAGS_NOMAP="-L$MATLAB/bin/${MATLAB_ARCH} -Wl,-twolevel_namespace -undefined error -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle" MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,-exported_symbols_list,$(pwd)/$srcdir/mexFunction-MacOSX.map" - MATLAB_LIBS="-lmx -lmex -lmat -lstdc++ -lmwlapack" - # Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries - AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} -lmwblas"]) + MATLAB_LIBS="-lmx -lmex -lmat -lstdc++ -lmwlapack -lmwblas" ax_mexopts_ok="yes" ;; *) diff --git a/matlab/dynare.m b/matlab/dynare.m index 034ec06745cef22bbec94c0d7eae582e530bd4d3..6efd76ee7045df31754cbaa76702e8210acaa185 100644 --- a/matlab/dynare.m +++ b/matlab/dynare.m @@ -16,7 +16,7 @@ function dynare(fname, varargin) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2001-2013 Dynare Team +% Copyright (C) 2001-2014 Dynare Team % % This file is part of Dynare. % @@ -54,8 +54,8 @@ if isoctave warning('This version of Dynare has only been tested on Octave 3.6.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.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.'); + if matlab_ver_less_than('7.5') + warning('This version of Dynare has only been tested on MATLAB 7.5 (R2007b) 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 diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m index 4405c12e8ec9be0e8c7d243906d5e35a6ee6cb50..1e9ed323309a9e8f11ffa8b985ba17fa5743c547 100644 --- a/matlab/dynare_config.m +++ b/matlab/dynare_config.m @@ -15,7 +15,7 @@ function dynareroot = dynare_config(path_to_dynare,verbose) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2001-2013 Dynare Team +% Copyright (C) 2001-2014 Dynare Team % % This file is part of Dynare. % @@ -84,13 +84,8 @@ if isoctave addpath([dynareroot '/missing/ordeig']) end -% bsxfun is missing in old versions of MATLAB (and exists in Octave) -if ~isoctave && matlab_ver_less_than('7.4') - addpath([dynareroot '/missing/bsxfun']) -end - -% ilu is missing in old versions of MATLAB and in Octave -if isoctave || matlab_ver_less_than('7.4') +% ilu is missing in Octave +if isoctave addpath([dynareroot '/missing/ilu']) end @@ -113,27 +108,15 @@ if isoctave else % Add win32 specific paths for Dynare Windows package if strcmp(computer, 'PCWIN') - if matlab_ver_less_than('7.5') - mexpath = [dynareroot '../mex/matlab/win32-7.3-7.4']; - if exist(mexpath, 'dir') - addpath(mexpath) - end - else - mexpath = [dynareroot '../mex/matlab/win32-7.5-8.2']; - if exist(mexpath, 'dir') - addpath(mexpath) - end + mexpath = [dynareroot '../mex/matlab/win32-7.5-8.2']; + if exist(mexpath, 'dir') + addpath(mexpath) end end % Add win64 specific paths for Dynare Windows package if strcmp(computer, 'PCWIN64') - if matlab_ver_less_than('7.5') - mexpath = [dynareroot '../mex/matlab/win64-7.3-7.4']; - if exist(mexpath, 'dir') - addpath(mexpath) - end - elseif matlab_ver_less_than('7.8') + if matlab_ver_less_than('7.8') mexpath = [dynareroot '../mex/matlab/win64-7.5-7.7']; if exist(mexpath, 'dir') addpath(mexpath) @@ -147,16 +130,9 @@ else end if strcmp(computer, 'MACI') - if matlab_ver_less_than('7.5') - mexpath = [dynareroot '../mex/matlab/osx32-7.4']; - if exist(mexpath, 'dir') - addpath(mexpath) - end - else - mexpath = [dynareroot '../mex/matlab/osx32-7.5-7.11']; - if exist(mexpath, 'dir') - addpath(mexpath) - end + mexpath = [dynareroot '../mex/matlab/osx32-7.5-7.11']; + if exist(mexpath, 'dir') + addpath(mexpath) end end diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m index cf78883eb25063fe1d2ff751926bc9d523990fc8..c331eece002ced76a29c7ae43b839429984b69a6 100644 --- a/matlab/global_initialization.m +++ b/matlab/global_initialization.m @@ -11,7 +11,7 @@ function global_initialization() % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2013 Dynare Team +% Copyright (C) 2003-2014 Dynare Team % % This file is part of Dynare. % @@ -130,9 +130,7 @@ if isoctave options_.nodisplay = 1; end else - if isunix && (~usejava('jvm') || ... - ((matlab_ver_less_than('7.5') && sum(get(0,'ScreenSize'))==4) || ... - (~matlab_ver_less_than('7.5') && ~feature('ShowFigureWindows')))) + if isunix && (~usejava('jvm') || ~feature('ShowFigureWindows')) options_.console_mode = 1; options_.nodisplay = 1; end diff --git a/matlab/matlab_ver_less_than.m b/matlab/matlab_ver_less_than.m index faec3a5c6f0e17ac0afe30391049f6cfff137907..eb708d7fcac8bed38f68bcbd405605675387c1b3 100644 --- a/matlab/matlab_ver_less_than.m +++ b/matlab/matlab_ver_less_than.m @@ -4,9 +4,6 @@ function r = matlab_ver_less_than(verstr) % Returns 1 if current Matlab version is strictly older than % the one given in argument. % -% It basically does the same job than verLessThan(), which is -% only available since Matlab 7.4. -% % Note that this function will fail under Octave. % % INPUTS @@ -18,7 +15,7 @@ function r = matlab_ver_less_than(verstr) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2008-2009 Dynare Team +% Copyright (C) 2008-2014 Dynare Team % % This file is part of Dynare. % @@ -35,15 +32,4 @@ function r = matlab_ver_less_than(verstr) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -ver_struct = ver('matlab'); -cur_verstr = ver_struct.Version; - -r = get_ver_numeric(cur_verstr) < get_ver_numeric(verstr); - - -function x = get_ver_numeric(verstr) -nums = sscanf(verstr, '%d.%d.%d')'; -if length(nums) < 3 - nums(3) = 0; -end -x = nums * [1; 0.01; 0.0001 ]; +r = verLessThan('matlab', verstr) diff --git a/matlab/missing/bsxfun/bsxfun.m b/matlab/missing/bsxfun/bsxfun.m deleted file mode 100644 index ed2f5f2cd1284ba5c4ab500f1b942af253e26028..0000000000000000000000000000000000000000 --- a/matlab/missing/bsxfun/bsxfun.m +++ /dev/null @@ -1,53 +0,0 @@ -function C = bsxfun(fun,A,B) -% (Imperfect) Clone of matlab's bsxfun built-in function. - -% Copyright (C) 2010-2011 Dynare Team -% -% This file is part of Dynare. -% -% Dynare is free software: you can redistribute it and/or modify -% it under the terms of the GNU General Public License as published by -% the Free Software Foundation, either version 3 of the License, or -% (at your option) any later version. -% -% Dynare is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -% GNU General Public License for more details. -% -% You should have received a copy of the GNU General Public License -% along with Dynare. If not, see <http://www.gnu.org/licenses/>. - -dA = size(A); -dB = size(B); - -dim_correction = length(dA)-length(dB); -if dim_correction>0 - dB = [dB,ones(1,dim_correction)]; -elseif dim_correction<0 - dA = [dA,ones(1,-dim_correction)]; -end - -if all(dA==dB) - C = fun(A,B); -else - tB = dB<dA; - tA = dA<dB; - if any(tB) - iB = find(tB); - if all(dB(iB)==1) - B = repmat(B,tB.*dA+~tB); - else - error('Non-singleton dimensions of the two input arrays must match each other.') - end - end - if any(tA) - iA = find(tA); - if all(dA(iA)==1) - A = repmat(A,tA.*dB+~tA); - else - error('Non-singleton dimensions of the two input arrays must match each other.') - end - end - C = fun(A,B); -end \ No newline at end of file diff --git a/matlab/parallel/GiveCPUnumber.m b/matlab/parallel/GiveCPUnumber.m index 3176bb1a54df191b20331571858acfde6e6cbd42..2666d97634c4eef4ed6eef738ae24a3d0a1dac71 100644 --- a/matlab/parallel/GiveCPUnumber.m +++ b/matlab/parallel/GiveCPUnumber.m @@ -36,7 +36,7 @@ nCPU=''; if nargin < 2, % Determine a specific operating system or software version when necessary % for different command (sintax, name, ...). -Environment=~ispc; %isunix || (~matlab_ver_less_than('7.4') && ismac); +Environment=~ispc; end switch Environment diff --git a/matlab/parallel/dynareParallelDir.m b/matlab/parallel/dynareParallelDir.m index d257e8090e51c20846e0c16aad33cb59b34500b5..daecfe6cd49707b955f7fc1d25ca55987d4d3423 100644 --- a/matlab/parallel/dynareParallelDir.m +++ b/matlab/parallel/dynareParallelDir.m @@ -29,7 +29,7 @@ function dirlist = dynareParallelDir(filename,PRCDir,Parallel) dirlist=[]; for indPC=1:length(Parallel), - if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac), + if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), if Parallel(indPC).Local==0, if ~isempty(Parallel(indPC).Port), ssh_token = ['-p ',Parallel(indPC).Port]; diff --git a/matlab/parallel/dynareParallelGetFiles.m b/matlab/parallel/dynareParallelGetFiles.m index dbd13d683149cfc04c84d75f8f0cbdd87368a9ed..bdb6d0143be9ffef0aecf0713e0aa363b9c0f737 100644 --- a/matlab/parallel/dynareParallelGetFiles.m +++ b/matlab/parallel/dynareParallelGetFiles.m @@ -35,7 +35,7 @@ NamFileInput0=NamFileInput; for indPC=1:length(Parallel), if Parallel(indPC).Local==0, - if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac), + if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), if ~isempty(Parallel(indPC).Port), ssh_token = ['-p ',Parallel(indPC).Port]; else diff --git a/matlab/parallel/dynareParallelMkDir.m b/matlab/parallel/dynareParallelMkDir.m index 7ebde3819ccd531372ffdf26e116a41af182fad0..9e8d7b7de75573706fc875d9a72a64ec3c7cad33 100644 --- a/matlab/parallel/dynareParallelMkDir.m +++ b/matlab/parallel/dynareParallelMkDir.m @@ -36,7 +36,7 @@ end for indPC=1:length(Parallel) if Parallel(indPC).Local==0, - if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac), + if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), if ~isempty(Parallel(indPC).Port), ssh_token = ['-p ',Parallel(indPC).Port]; else diff --git a/matlab/parallel/dynareParallelSendFiles.m b/matlab/parallel/dynareParallelSendFiles.m index d76f8a7bd575ef1ec322970d210bb0f70da6e35f..6f7e645f55fa916888713603587c8b44f1a627a6 100644 --- a/matlab/parallel/dynareParallelSendFiles.m +++ b/matlab/parallel/dynareParallelSendFiles.m @@ -41,7 +41,7 @@ end for indPC=1:length(Parallel), if Parallel(indPC).Local==0, - if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac), + if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), if ~isempty(Parallel(indPC).Port), ssh_token = ['-p ',Parallel(indPC).Port]; else diff --git a/matlab/parallel/masterParallel.m b/matlab/parallel/masterParallel.m index a0657176ffe549baaf25ab2b7f9856e3bcefe098..6b218310ec72116eb23ea91e2d125303bc981097 100644 --- a/matlab/parallel/masterParallel.m +++ b/matlab/parallel/masterParallel.m @@ -147,7 +147,7 @@ end DyMo=pwd; % fInputVar.DyMo=DyMo; -if ispc, % ~(isunix || (~matlab_ver_less_than('7.4') && ismac)) , +if ispc, [tempo, MasterName]=system('hostname'); MasterName=deblank(MasterName); end @@ -499,7 +499,7 @@ if Strategy==0 || newInstance, % See above. PRCDirSnapshotInit = PRCDirSnapshot; % Run the slaves. - if ~ispc, %isunix || (~matlab_ver_less_than('7.4') && ismac), + if ~ispc, system('sh ConcurrentCommand1.bat &'); pause(1) else diff --git a/matlab/set_dynare_seed.m b/matlab/set_dynare_seed.m index fbde1abc305ee0671ef3e8761c7ebb4a1cacebd8..3a71d7236c03ff64feeaff862cdd5b0bbac681e7 100644 --- a/matlab/set_dynare_seed.m +++ b/matlab/set_dynare_seed.m @@ -2,7 +2,7 @@ function set_dynare_seed(a,b) % Set seeds depending on matlab (octave) version. This routine is called in dynare_config and can be called by the % user in the mod file. % -% Copyright (C) 2010-2013 Dynare Team +% Copyright (C) 2010-2014 Dynare Team % % This file is part of Dynare. % @@ -93,10 +93,9 @@ if matlab_random_streams% Use new matlab interface. else% Use old matlab interface. if nargin==1 if ischar(a) && strcmpi(a,'default') - if isoctave || matlab_ver_less_than('7.4') + if isoctave options_.DynareRandomStreams.algo = 'state'; else - % Twister was introduced in MATLAB 7.4 options_.DynareRandomStreams.algo = 'twister'; end options_.DynareRandomStreams.seed = 0; diff --git a/mex/sources/dynmex.h b/mex/sources/dynmex.h index 713f3dd7ff44573284e0e83e7fd9a8fb329165c7..17015fb20c90849da374f2825824e1cc634cd1ea 100644 --- a/mex/sources/dynmex.h +++ b/mex/sources/dynmex.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2011 Dynare Team + * Copyright (C) 2009-2014 Dynare Team * * This file is part of Dynare. * @@ -26,12 +26,6 @@ #include <mex.h> -/* mwSize, mwIndex and mwSignedIndex appeared in MATLAB 7.3 */ -#if defined(MATLAB_MEX_FILE) && MATLAB_VERSION < 0x0703 -typedef int mwIndex; -typedef int mwSize; -#endif - /* * Fix for trac ticket Ticket #137 */ diff --git a/windows/README.txt b/windows/README.txt index bea713b7ca6c4e0b47dbd330e4fc730cd09b2ec8..02ee18ecf5201755c039cf2715c72c2e538277a9 100644 --- a/windows/README.txt +++ b/windows/README.txt @@ -25,7 +25,7 @@ NOTE: Dynare comes with an automated uninstaller, which you can run from the Using Dynare with MATLAB (R) ---------------------------- -Dynare requires MATLAB (R) version 7.3 (R2006b) or above. With older versions +Dynare requires MATLAB (R) version 7.5 (R2007b) 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 diff --git a/windows/dynare.nsi b/windows/dynare.nsi index e2fbc886d336da235c0777122d2204d8158b1c3d..cabf33e114c3ea81a0e66f4cca1baa3c5c25d440 100644 --- a/windows/dynare.nsi +++ b/windows/dynare.nsi @@ -83,21 +83,11 @@ SectionEnd SectionGroup "MEX files for MATLAB" -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 -SectionEnd - Section "MEX files for MATLAB 32-bit, version 7.5 to 8.2 (R2007b to R2013b)" SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.2 File ..\mex\matlab\win32-7.5-8.2\*.mexw32 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 -SectionEnd - Section "MEX files for MATLAB 64-bit, version 7.5 to 7.7 (R2007b to R2008b)" SetOutPath $INSTDIR\mex\matlab\win64-7.5-7.7 File ..\mex\matlab\win64-7.5-7.7\*.mexw64