From b2c554623f55bc26492aec27f8e7beb0a9bf2069 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 28 Jun 2018 17:34:14 +0200
Subject: [PATCH] Various fixes related to the new layout of generated files

---
 matlab/dynare.m                     | 5 +++++
 matlab/getH.m                       | 4 ++--
 mex/sources/bytecode/Interpreter.cc | 2 +-
 tests/block_bytecode/run_ls2003.m   | 5 -----
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/matlab/dynare.m b/matlab/dynare.m
index 569b2975a6..369c43b9c1 100644
--- a/matlab/dynare.m
+++ b/matlab/dynare.m
@@ -283,4 +283,9 @@ end
 if ~ isempty(find(abs(fname) == 46))
     fname = fname(:,1:find(abs(fname) == 46)-1) ;
 end
+
+% We need to clear the driver (and only the driver, because the "clear all"
+% within the driver will clean the rest)
+clear(['+' fname '/driver'])
+
 evalin('base',[fname '.driver']) ;
diff --git a/matlab/getH.m b/matlab/getH.m
index 1c06dbadee..a7de28bc08 100644
--- a/matlab/getH.m
+++ b/matlab/getH.m
@@ -201,11 +201,11 @@ else
         end
     end
     if nargout>5
-        [df, gp, d2f, gpp, hp] = feval([M_.fname,'_params_derivs'],yy0, oo_.exo_steady_state', ...
+        [df, gp, d2f, gpp, hp] = feval([M_.fname,'.dynamic_params_derivs'],yy0, oo_.exo_steady_state', ...
                                        M_.params, oo_.dr.ys, 1, dyssdtheta, d2yssdtheta);
         H2ss = d2yssdtheta(oo_.dr.order_var,indx,indx);
     else
-        [df, gp] = feval([M_.fname,'_params_derivs'],yy0, repmat(oo_.exo_steady_state',[M_.maximum_exo_lag+M_.maximum_exo_lead+1,1]), ...
+        [df, gp] = feval([M_.fname,'.dynamic_params_derivs'],yy0, repmat(oo_.exo_steady_state',[M_.maximum_exo_lag+M_.maximum_exo_lead+1,1]), ...
                          M_.params, oo_.dr.ys, 1, dyssdtheta,d2yssdtheta);
         [residual, g1, g2 ] = feval([M_.fname,'.dynamic'],yy0, repmat(oo_.exo_steady_state',[M_.maximum_exo_lag+M_.maximum_exo_lead+1,1]), ...
                                     M_.params, oo_.dr.ys, 1);
diff --git a/mex/sources/bytecode/Interpreter.cc b/mex/sources/bytecode/Interpreter.cc
index 0e25424179..bb986cff8d 100644
--- a/mex/sources/bytecode/Interpreter.cc
+++ b/mex/sources/bytecode/Interpreter.cc
@@ -587,7 +587,7 @@ Interpreter::ReadCodeFile(string file_name, CodeLoad &code)
   if (!code_liste.size())
     {
       ostringstream tmp;
-      tmp << " in compute_blocks, " << file_name.c_str() << " cannot be opened\n";
+      tmp << " in compute_blocks, " << file_name << ".cod cannot be opened\n";
       throw FatalExceptionHandling(tmp.str());
     }
   if (block >= (int) code.get_block_number())
diff --git a/tests/block_bytecode/run_ls2003.m b/tests/block_bytecode/run_ls2003.m
index 0b1d898e34..892f842290 100644
--- a/tests/block_bytecode/run_ls2003.m
+++ b/tests/block_bytecode/run_ls2003.m
@@ -17,11 +17,6 @@ function run_ls2003(block, bytecode, solve_algo, stack_solve_algo)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-  % Workaround for a strange race condition under Octave
-  if exist('ls2003_tmp.m') == 2
-      delete('ls2003_tmp.m')
-  end
-
   disp(['TEST: ls2003 (block=' num2str(block) ', bytecode=' ...
       num2str(bytecode) ', solve_algo=' num2str(solve_algo) ...
       ', stack_solve_algo=' num2str(stack_solve_algo) ')...']);
-- 
GitLab