Can't work with third order

Also, could you please check whether there is a *.jnl-file created in the folder. If yes, please post it here.

I am encountering the same issue.

I have a .mod file that had worked in 4.4.3 with a third-order perturbation solver but no longer works with 4.5.1.

It still works with order=1 option.

I have attempted to run my file in both a Windows 7 machine and a Mac with macOS Sierra. My MATLAB is R2016b. With Windows, MATLAB simply crashes as tianyuwuhe’s experience. On the Mac I get the following error message:

Invalid MEX-file '/Applications/Dynare/4.5.0/matlab/../mex/matlab/osx/k_order_perturbation.mexmaci64':
dlopen(/Applications/Dynare/4.5.0/matlab/../mex/matlab/osx/k_order_perturbation.mexmaci64, 6): Library not
loaded: @rpath/libhdf5.6.dylib
  Referenced from: /Applications/Dynare/4.5.0/mex/matlab/osx/k_order_perturbation.mexmaci64
  Reason: image not found.

(As you can see, I have tried with 4.5.0 as well.)


HI,dear experts:
Following your advice ,I found the log file generated when Matlab crashed, also I discoverd two facts using Dynare 4.5.1 diffent from using Dynare 4.4.3. First, aftering running the model using Dynare 4.5.1, there is an file named checksum which isn’t generated in Dynare 4.4.3. Second.aftering running the model using Dynare 4.5.1 first with order=3,Dynare didn’t automatically add any required subfolders in the matlab’s path,and the error hint in error.bmp shows up sometimes.Here is the (17.3 KB). I think something is wrong with my Matlab,but don’t know what to do about it. Thank for your patient reply.

Hi Feng,

Have you had any luck resolving the issue?

@jpfeifer: Given that this is an issue that appears across platforms, might there be a bug in Dynare such that it works for first-order solution, but not with second- or third-order?


@tlin Your mac problem is one with building the mex-files. It is different from the crash on Windows. Our developer dealing with Macs will hopefully get back to you soon.

@tlin and @tianyuwuhe For Windows, as I said

What puzzles me is that I can run the respective file at third order on Windows 10, 64bit, Dynare 4.5.1. Could you please try what happens if you run

stoch_simul (order=3, pruning, nocorr, nomoments, irf=12,irf_shocks=(epsh));

i.e. only request the IRF to a single shock.

Thank you, @jpfeifer, for the response!

I have run @tianyuwuhe’s model and reproduced the error. The resulting jnl is attached in the zip file. Note that Dynare/MATLAB crashes running either the model with just one single shock or all shocks. (1.3 KB)


I have attached the dump file below. (1.3 KB)

I opened a ticket at
Could you please check which version of C:\Windows\system32\msvcrt.dll you have on your machine. You should be able to find this info in the file details in the Windows Explorer

I apologize for the delay.

The msvcrt.dll version is 7.0.7601.17744.

Mine is 7.0.15063.0. What is the latest Visual C++ Redistributable on your machine? Mine in 2015.

According to Control Panel, it is 2015, 14.0.23506.

To clarify, the machine has MS Visual C++ 2015 Redistributable (x64) - 14.0.23506.

Could you please try reinstalling it? My version is 14.0.23918

I have just installed the latest update of MS Visual C++ 2015 Redistributable; it is now 14.0.24212.

However, my msvcrt.dll has not changed; it is still version 7.0.7601.17744.

I am attaching the .jnl after MATLAB crashes. It did not generate a dump file. (2.4 KB)

That is strange. Now it crashes in a different step.I am attaching my dll. Try backing up yours and replacing it by mine. (290.8 KB)

No luck. (1.0 KB)

Regarding OSX, I did not try with the official package distributed on but your file runs fine if you install Dynare with Homebrew. Assuming Homebrew is correctly installed, you just have to do:

~$ brew install dynare --with-matlab=/Applications/ --with-matlab-version=R2016b

in a terminal to install the latest stable version of Dynare. More details are provided here.


I have just opened issue #1492 on Github. I can reproduce the problem with the official OS X package for 4.5.1, it is probably an issue with your build system. The only temporary fix is to install Dynare with Homebrew.

Thank you, @stepan-a!

@tlin the macOS installer package has been updated. You should now be able to use it to run k_order. If you install it and encounter the same issue, please try installing from here: (sometimes browsers cache downloads and won’t recognize that the package has changed)