Skip to content
Snippets Groups Projects
Verified Commit cafc9713 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

bug: do not remove +subfolder with fast option

Otherwise, expected files are not present

(cherry picked from commit 643face6)
parent 3b8945c0
Branches
Tags
No related merge requests found
...@@ -408,9 +408,11 @@ by the ``dynare`` command. ...@@ -408,9 +408,11 @@ by the ``dynare`` command.
.. option:: fast .. option:: fast
Only useful with model option :opt:`use_dll`. Don’t recompile the Don’t rewrite the output files otherwise written to the disk by the preprocessor
MEX files when running again the same model file and the lists when re-running the same model file while the lists of variables and the equations
of variables and the equations haven’t changed. We use a 32 haven’t changed. Note that the whole model still needs to be preprocessed. This option
is most useful with model option :opt:`use_dll`, because
the time-consuming compilation of the MEX files will be skipped. We use a 32
bit checksum, stored in ``<model filename>/checksum``. There bit checksum, stored in ``<model filename>/checksum``. There
is a very small probability that the preprocessor misses a is a very small probability that the preprocessor misses a
change in the model. In case of doubt, re-run without the fast change in the model. In case of doubt, re-run without the fast
......
...@@ -180,6 +180,7 @@ preprocessoroutput = ~ismember('nopreprocessoroutput', varargin) && ... ...@@ -180,6 +180,7 @@ preprocessoroutput = ~ismember('nopreprocessoroutput', varargin) && ...
nolog = ismember('nolog', varargin) || ismember('nolog', file_opts); nolog = ismember('nolog', varargin) || ismember('nolog', file_opts);
onlymacro = ismember('onlymacro', varargin) || ismember('onlymacro', file_opts); onlymacro = ismember('onlymacro', varargin) || ismember('onlymacro', file_opts);
onlyjson = ismember('onlyjson', varargin) || ismember('onlyjson', file_opts); onlyjson = ismember('onlyjson', varargin) || ismember('onlyjson', file_opts);
fast = ismember('fast', varargin) || ismember('fast', file_opts);
% Start journal % Start journal
diary off diary off
...@@ -222,12 +223,14 @@ end ...@@ -222,12 +223,14 @@ end
% On MATLAB+Windows, the +folder may be locked by MATLAB, preventing its % On MATLAB+Windows, the +folder may be locked by MATLAB, preventing its
% removal by the preprocessor. % removal by the preprocessor.
% Trying to delete it here will actually fail, but surprisingly this allows % Trying to delete it here will actually fail, but surprisingly this allows
% the preprocessor to actually remove the folder (see ModFile::writeOutputFiles()) % the preprocessor to actually remove the folder (see ModFile::writeMOutput())
% For an instance of this bug, see: % For an instance of this bug, see:
% https://forum.dynare.org/t/issue-with-dynare-preprocessor-4-6-1/15448/1 % https://forum.dynare.org/t/issue-with-dynare-preprocessor-4-6-1/15448/1
if ~fast
if ispc && ~isoctave && exist(['+',fname(1:end-4)],'dir') if ispc && ~isoctave && exist(['+',fname(1:end-4)],'dir')
[~,~]=rmdir(['+', fname(1:end-4)],'s'); [~,~]=rmdir(['+', fname(1:end-4)],'s');
end end
end
% Under Windows, make sure the MEX file is unloaded (in the use_dll case), % Under Windows, make sure the MEX file is unloaded (in the use_dll case),
% otherwise the preprocessor can't recompile it % otherwise the preprocessor can't recompile it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment