System cannot find the path specified error (only in dynare 5.1 and older)

Hi There,

I have encountered the following issue (under Matlab R2021a): when trying to run any .mod file in versions of dynare up to 5.1 (I’ve tried 4.5.7, 4.6.4, 5.0 and 5.1) I first get a number of X12 warning messages and then an error message to the following effect:

Starting Dynare (version 5.1).
Calling Dynare with arguments: none
The system cannot find the path specified.

Error using dynare (line 269)
Dynare: preprocessing failed

The exact same .mod file will run perfectly in version 5.2 and newer (I switch between versions by restarting Matlab and moving the relevant dynare\matlab directory to the top of my path). The issue (dynare acting as if it doesn’t see the .mod file) is not restricted to a single .mod file or directory, and in the older versions seems caused by the system command malfunctioning…

The simplest solution would be to only run the latest dynare version, but it so happens that I have some legacy code that won’t run under newer versions (and which I need to get running ASAP). So I’m wondering if anyone has a fix to get older dynare versions running again? Particularly as the underlying issue seems to have been addressed in the revision from 5.1 to 5.2?

Many thanks in advance for any suggestions!

I have never seen something like this. We had cryptic issues like this in past when users installed Dynare in folders where they did not have sufficient permissions, e.g. as a subfolder of the Matlab installation. Which operating system are you using?

Thanks a lot Johannes!

I think I’ve now sorted the issue out, so providing more details in the (I think unlikely) event that anyone else runs into it. The short story seems to be that I have picked up multiple corrupt dynare installation files (I downloaded a bunch of them at the same time in 2022). As in, deleting and reinstalling dynare 4.6.4 and then 5.1 now allows me to run everything without issues…

Below is the long story in case anyone finds the version above suspicious / thinks I’ve gone nuts :wink:

Starting with your question, Johannes: I’m on Windows 11 Pro, which is showing as up to date in windows update:

I do have admin rights and I don’t think there is anything funny with the location (my only suspicion was dropbox, but it was paused, and I’ve replicated all the errors in a different directory not linked to dropbox).

For reference, here’s a screenshot with more Matlab details and also the path settings:

So, first of all, here’s a replication of the error in dynare 5.1:

With the same command running ok under dynare 5.2:

For the avoidance of doubt, I also tried removing references to all other dynare versions from the path but that didn’t do the trick…

I then debugged 5.1 and 5.2 when running dynare on Test.mod. While the error is linked to line 269, the devil seems to be in line 243:
[status, result] = system(command);

The contents of command when running 5.1 are

'"C:\dynare\5.1\matlab\..\preprocessor\dynare-preprocessor" Test.mod mexext=mexw64 "matlabroot=C:\Program Files\Matlab\R2021a"'

In 5.2 it looks literally identical, except for 5.1 being replaced by 5.2, i.e., I get:

'"C:\dynare\5.2\matlab\..\preprocessor\dynare-preprocessor" Test.mod mexext=mexw64 "matlabroot=C:\Program Files\Matlab\R2021a"'

Inspecting the paths revealed that the dynare 5.1 installation didn’t have a


folder, which was the source of the error. Question I asked myself being, why was dynare 5.1 trying to run something from a non-existent folder (I ran a stock installation)?

I checked and the same thing happened with version 4.6.4, where the command (this time in line 249) evaluated to:

'"C:\dynare\4.6.4\matlab\preprocessor64\dynare_m" Test.mod mexext=mexw64 "matlabroot=C:\Program Files\Matlab\R2021a"'

So the path was different, but the common issue was that the 4.6.4 installation didn’t have a



This is precisely what led me to wonder whether the dynare installations hadn’t gone corrupt, somehow. After reinstalling, I now do have a preprocessor64 subfolder of Matlab in 4.6.4, which is why things work ok. And the C:\dynare\5.1\preprocessor also appeared after I reinstalled 5.1.

So ok, I may have accidentally and inadvertently deleted multiple preprocessor directories, but I like the corrupt installation files theory more (I was installing on the 2nd of October 2022 around 3:30pm so that’s where I’d pinpoint the issue to). In any case, everything working now, so can’t ask for more :grinning:

Thanks again for taking the time to read and help, Johannes - always much appreciated!

ps. Obviously, open to dissenting views on what was going on…

Thanks for the update. It turns out that the missing file is an .exe-executable. What may have happened is that the installation triggered your Antivirus program and blocked the installer from creating these files.

Thanks, Johannes - I think your theory is better than both of mine (particularly if the “last modified” dates on Index of /release/windows can be trusted; since they suggest I’m downloading the same files now as I did back in 2022). More specifically, I did have bitdefender running when installing dynare originally, which I have since gotten rid of, so all pieces of the puzzle would fit nicely.

Thanks again!