From e71e89bb38270599a3e5749f3cc7efd336eeb125 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 26 Jan 2017 14:39:15 +0100
Subject: [PATCH] Added check on Octave version.

---
 matlab/dynare_config.m            |  9 +++++++++
 matlab/supported_octave_version.m | 20 ++++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 matlab/supported_octave_version.m

diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m
index fc89f1539e..c70e0a89f6 100644
--- a/matlab/dynare_config.m
+++ b/matlab/dynare_config.m
@@ -91,6 +91,15 @@ if isoctave
     p{end+1} = '/missing/ordeig';
 end
 
+if isoctave && ~isequal(supported_octave_version(), version())
+    skipline()
+    warning(['This version of Octave is not supported. Consider installing ' ...
+             'version %s of Octave,\notherwise m files will be used instead ' ...
+             'of precompiled mex files and some features, like solution\n' ...
+             'of models approximated at third order, will not be available.'], supported_octave_version())
+    skipline()
+end
+
 % ilu is missing in Octave < 4.0
 if isoctave && octave_ver_less_than('4.0')
     p{end+1} = '/missing/ilu';
diff --git a/matlab/supported_octave_version.m b/matlab/supported_octave_version.m
new file mode 100644
index 0000000000..9f6f2d633d
--- /dev/null
+++ b/matlab/supported_octave_version.m
@@ -0,0 +1,20 @@
+function v = supported_octave_version()
+
+% Copyright (C) 2017 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/>.
+
+v = '4.2.0';
\ No newline at end of file
-- 
GitLab