v4:
* added a warning when Matlab < 6.5 or Octave < 3.0.0 * created octave_ver_less_than.m git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1941 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
b99a83d1be
commit
57f4d42a5b
|
@ -19,14 +19,23 @@ function dynare(fname, varargin)
|
|||
% part of DYNARE, copyright Dynare Team (2001-2008)
|
||||
% Gnu Public License.
|
||||
|
||||
warning_config
|
||||
|
||||
if exist('OCTAVE_VERSION')
|
||||
if octave_ver_less_than('3.0.0')
|
||||
warning('This version of Dynare has only been tested on Octave 3.0.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('6.5')
|
||||
warning('This version of Dynare has only been tested on Matlab 6.5 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
|
||||
|
||||
if nargin < 1
|
||||
error('You must provide the name of the MOD file in argument');
|
||||
end
|
||||
|
||||
|
||||
warning_config
|
||||
|
||||
% disable output paging
|
||||
% disable output paging (it is on by default on Octave)
|
||||
more off
|
||||
|
||||
% sets default format for save() command
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
function r = octave_ver_less_than(verstr)
|
||||
% function r = octave_ver_less_than(verstr)
|
||||
%
|
||||
% Returns 1 if current Octave version is strictly older than
|
||||
% the one given in argument.
|
||||
%
|
||||
% Note that this function will fail under Matlab.
|
||||
%
|
||||
% INPUTS
|
||||
% verstr: a string of the format 'x.y' or 'x.y.z'
|
||||
%
|
||||
% OUTPUTS
|
||||
% r: 0 or 1
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
%
|
||||
% part of DYNARE, copyright Dynare Team (2008)
|
||||
% Gnu Public License.
|
||||
|
||||
cur_verstr = 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 ];
|
Loading…
Reference in New Issue