Bump minimal required version of Octave to 7.1.0

Incidentally, this means that the JSONlab submodule is no longer needed, so it
is removed in the present commit.

Closes: #1907
dcontrib-log
Sébastien Villemot 2023-11-22 17:17:34 +01:00
parent d55b6c68f9
commit 1d5a442fe5
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
16 changed files with 11 additions and 58 deletions

3
.gitmodules vendored
View File

@ -14,9 +14,6 @@
path = matlab/modules/dseries path = matlab/modules/dseries
url = ../../Dynare/dseries.git url = ../../Dynare/dseries.git
branch = master branch = master
[submodule "contrib/jsonlab"]
path = contrib/jsonlab
url = https://github.com/fangq/jsonlab.git
[submodule "preprocessor"] [submodule "preprocessor"]
path = preprocessor path = preprocessor
url = ../../Dynare/preprocessor.git url = ../../Dynare/preprocessor.git

@ -1 +0,0 @@
Subproject commit 5a58fafdca239e61be4d7b2270307b2445bb571a

View File

@ -15,7 +15,7 @@ compilation steps are necessary in that case.
In order to run Dynare, you need one of the following: In order to run Dynare, you need one of the following:
* MATLAB, any version ranging from 9.5 (R2018b) to 23.2 (R2023b); * MATLAB, any version ranging from 9.5 (R2018b) to 23.2 (R2023b);
* GNU Octave, any version ranging from 6.2.0 to 8.4.0, with the statistics package * GNU Octave, any version ranging from 7.1.0 to 8.4.0, with the statistics package
from `Octave-Forge`_. Note however that the Dynare installer for Windows from `Octave-Forge`_. Note however that the Dynare installer for Windows
requires a more specific version of Octave, as indicated on the download requires a more specific version of Octave, as indicated on the download
page. page.

View File

@ -145,7 +145,6 @@ fi
cp -p "$ROOTDIR"/scripts/dynare.el "$PKGFILES"/scripts cp -p "$ROOTDIR"/scripts/dynare.el "$PKGFILES"/scripts
cp -pr "$ROOTDIR"/contrib/ms-sbvar/TZcode/MatlabFiles "$PKGFILES"/contrib/ms-sbvar/TZcode cp -pr "$ROOTDIR"/contrib/ms-sbvar/TZcode/MatlabFiles "$PKGFILES"/contrib/ms-sbvar/TZcode
cp -pr "$ROOTDIR"/contrib/jsonlab "$PKGFILES"/contrib
cp "$ROOTDIR"/build-doc/*.pdf "$PKGFILES"/doc cp "$ROOTDIR"/build-doc/*.pdf "$PKGFILES"/doc
cp "$ROOTDIR"/build-doc/preprocessor/doc/*.pdf "$PKGFILES"/doc cp "$ROOTDIR"/build-doc/preprocessor/doc/*.pdf "$PKGFILES"/doc

View File

@ -28,7 +28,7 @@ function nls(eqname, params, data, range, optimizer, varargin)
% equation must have NaN values in the object. % equation must have NaN values in the object.
% [4] It is assumed that the residual is additive. % [4] It is assumed that the residual is additive.
% Copyright © 2021-2022 Dynare Team % Copyright © 2021-2023 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -179,12 +179,6 @@ write_residuals_routine(lhs, rhs, eqname, ipnames_, M_);
% Create a routine for evaluating the sum of squared residuals of the nonlinear model % Create a routine for evaluating the sum of squared residuals of the nonlinear model
write_ssr_routine(lhs, rhs, eqname, ipnames_, M_); write_ssr_routine(lhs, rhs, eqname, ipnames_, M_);
% Workaround for Octave bug https://savannah.gnu.org/bugs/?46282
% Octave will randomly fail to read the ssr_* file generated in the +folder
if isoctave && octave_ver_less_than('7')
path(path)
end
% Create a function handle returning the sum of square residuals for a given vector of parameters. % Create a function handle returning the sum of square residuals for a given vector of parameters.
ssrfun = @(p) feval([M_.fname '.ssr_' eqname], p, DATA, M_, oo_); ssrfun = @(p) feval([M_.fname '.ssr_' eqname], p, DATA, M_, oo_);

View File

@ -42,7 +42,7 @@ function nls(eqname, params, data, range, optimizer, varargin)
% is available only if the matylab optimization toolbox is installed), the % is available only if the matylab optimization toolbox is installed), the
% remaining inputs are the options (key/value) passed to the optimizers. % remaining inputs are the options (key/value) passed to the optimizers.
% Copyright © 2018-2022 Dynare Team % Copyright © 2018-2023 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -96,12 +96,6 @@ write_residuals_routine(lhs, rhs, eqname, ipnames_, M_, pacmodl);
% Create a routine for evaluating the sum of squared residuals of the nonlinear model % Create a routine for evaluating the sum of squared residuals of the nonlinear model
write_ssr_routine(lhs, rhs, eqname, ipnames_, M_, pacmodl); write_ssr_routine(lhs, rhs, eqname, ipnames_, M_, pacmodl);
% Workaround for Octave bug https://savannah.gnu.org/bugs/?46282
% Octave will randomly fail to read the ssr_* file generated in the +folder
if isoctave && octave_ver_less_than('7')
path(path)
end
% Copy (sub)sample data in a matrix. % Copy (sub)sample data in a matrix.
DATA = data([range(1)-1, range]).data; DATA = data([range(1)-1, range]).data;

View File

@ -81,9 +81,9 @@ if isoctave
'of precompiled mex files and some\nfeatures, like solution ' ... 'of precompiled mex files and some\nfeatures, like solution ' ...
'of models approximated at third order, will not be available.'], supported_octave_version()) 'of models approximated at third order, will not be available.'], supported_octave_version())
skipline() skipline()
elseif octave_ver_less_than('6.2.0') % Should match the test in meson.build, and also the one in matlab/modules/dseries/src/initialize_dseries_class.m elseif octave_ver_less_than('7.1.0') % Should match the test in meson.build, and also the one in matlab/modules/dseries/src/initialize_dseries_class.m
skipline() skipline()
warning(['This version of Dynare has only been tested on Octave 6.2.0 and above. Dynare may fail to run or give unexpected result. Consider upgrading your version of Octave.']) warning(['This version of Dynare has only been tested on Octave 7.1.0 and above. Dynare may fail to run or give unexpected result. Consider upgrading your version of Octave.'])
skipline() skipline()
end end
else else

View File

@ -34,11 +34,6 @@ global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info
dispString = 'Estimation::mcmc'; dispString = 'Estimation::mcmc';
if ~exist([M_.dname filesep 'Output'],'dir') if ~exist([M_.dname filesep 'Output'],'dir')
if isoctave && octave_ver_less_than('7') && ~exist(M_.dname)
% See https://savannah.gnu.org/bugs/index.php?61166
% This workaround is needed for recursive estimation.
mkdir(M_.dname)
end
mkdir(M_.dname,'Output'); mkdir(M_.dname,'Output');
end end

View File

@ -1,6 +1,6 @@
function o = loadjson_(jsonfilename) function o = loadjson_(jsonfilename)
% Reads a json file using jsonlab toolbox or jsondecode builtin if available. % Reads a json file using jsondecode builtin.
% %
% INPUTS % INPUTS
% - jsonfilename [char] 1×n char array, name of the JSON file. % - jsonfilename [char] 1×n char array, name of the JSON file.
@ -28,11 +28,6 @@ function o = loadjson_(jsonfilename)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
if isoctave && octave_ver_less_than('7')
o = loadjson(jsonfilename);
return
end
json = fileread(jsonfilename); json = fileread(jsonfilename);
o = jsondecode(json); clear('json'); o = jsondecode(json); clear('json');

View File

@ -39,10 +39,6 @@ if nargin > 5 || nargin < 2 || nargout > 7 || nargout == 0
error('MJDGGES: takes 2, 3 or 4 input arguments and between 1 and 7 output arguments.') error('MJDGGES: takes 2, 3 or 4 input arguments and between 1 and 7 output arguments.')
end end
if isoctave && octave_ver_less_than('7')
error('Octave version 7 or higher is required (Octave 6 lacks the ordqz function)')
end
[me, ne] = size(e); [me, ne] = size(e);
[md, nd] = size(d); [md, nd] = size(d);
if ~isreal(e) || ~isreal(d) || me ~= ne || md ~= nd || me ~= nd if ~isreal(e) || ~isreal(d) || me ~= ne || md ~= nd || me ~= nd

@ -1 +1 @@
Subproject commit 99b6f167e71945a45249dbc6b5100d2ca6b1474f Subproject commit 80446e7cdcf392167e91b428b61d77e028e47674

View File

@ -27,7 +27,7 @@ function varargout = pooled_ols(ds, param_common, param_regex, overlapping_dates
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% dynare must have been run with the option: json=compute % dynare must have been run with the option: json=compute
% Copyright © 2017-2019 Dynare Team % Copyright © 2017-2023 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -76,10 +76,6 @@ else
end end
st = dbstack(1); st = dbstack(1);
if isoctave && octave_ver_less_than('6.3.0')
% Workaround for https://savannah.gnu.org/bugs/?60531, fixed in 6.3.0
st = st(2:end);
end
if ~isempty(st) && strcmp(st(1).name, 'pooled_fgls') if ~isempty(st) && strcmp(st(1).name, 'pooled_fgls')
save_structure_name = 'pooled_fgls'; save_structure_name = 'pooled_fgls';
else else

View File

@ -18,7 +18,7 @@ function varargout = sur(ds, param_names, eqtags, model_name, noniterative, ds_r
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% dynare must have been run with the option: json=compute % dynare must have been run with the option: json=compute
% Copyright © 2017-2021 Dynare Team % Copyright © 2017-2023 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -121,10 +121,6 @@ end
% %
st = dbstack(1); st = dbstack(1);
if isoctave && octave_ver_less_than('6.3.0')
% Workaround for https://savannah.gnu.org/bugs/?60531, fixed in 6.3.0
st = st(2:end);
end
if ~isempty(st) && strcmp(st(1).name, 'surgibbs') if ~isempty(st) && strcmp(st(1).name, 'surgibbs')
varargout{1} = nobs; varargout{1} = nobs;
varargout{2} = X{param_names{:}}.data; varargout{2} = X{param_names{:}}.data;

View File

@ -163,7 +163,7 @@ if get_option('build_for') == 'matlab'
else # Octave build else # Octave build
octave_exe = find_program('octave', required : not meson.is_cross_build(), disabler : true) octave_exe = find_program('octave', required : not meson.is_cross_build(), disabler : true)
mkoctfile_exe = find_program('mkoctfile') mkoctfile_exe = find_program('mkoctfile')
octave_minimal_version = '6.2.0' octave_minimal_version = '7.1.0'
octave_version = run_command(mkoctfile_exe, '-v', check : true).stdout().replace('mkoctfile, version ', '').strip() octave_version = run_command(mkoctfile_exe, '-v', check : true).stdout().replace('mkoctfile, version ', '').strip()
if octave_version.version_compare('<' + octave_minimal_version) if octave_version.version_compare('<' + octave_minimal_version)

View File

@ -36,13 +36,7 @@ if isoctave
mlist = mlist(find(~strcmp([matlab_dir filesep 'load_m_file_data_legacy.m'], mlist))); mlist = mlist(find(~strcmp([matlab_dir filesep 'load_m_file_data_legacy.m'], mlist)));
end end
% Set random seed, for reproducibility rng(1);
if isoctave && octave_ver_less_than('7')
randn('state',1);
rand('state',1);
else
rng(1);
end
failedtests = {}; failedtests = {};

View File

@ -119,8 +119,6 @@ cp -p windows/README.txt "$ZIPDIR"
cp -pr windows/deps/mingw64 "$ZIPDIR" cp -pr windows/deps/mingw64 "$ZIPDIR"
mkdir -p "$ZIPDIR"/contrib/ms-sbvar/TZcode mkdir -p "$ZIPDIR"/contrib/ms-sbvar/TZcode
cp -pr contrib/ms-sbvar/TZcode/MatlabFiles "$ZIPDIR"/contrib/ms-sbvar/TZcode cp -pr contrib/ms-sbvar/TZcode/MatlabFiles "$ZIPDIR"/contrib/ms-sbvar/TZcode
mkdir -p "$ZIPDIR"/contrib/jsonlab
cp -pr contrib/jsonlab/* "$ZIPDIR"/contrib/jsonlab
mkdir -p "$ZIPDIR"/mex/matlab/win64-9.5-23.2 mkdir -p "$ZIPDIR"/mex/matlab/win64-9.5-23.2
cp -p build-win-matlab/*.mexw64 "$ZIPDIR"/mex/matlab/win64-9.5-23.2 cp -p build-win-matlab/*.mexw64 "$ZIPDIR"/mex/matlab/win64-9.5-23.2
mkdir -p "$ZIPDIR"/mex/octave/win64 mkdir -p "$ZIPDIR"/mex/octave/win64