Dynare 5.5 MAC OS ARM-64 MAC M2

Hi, I recently downloaded Dynare (5.5 version) for the first time in my Mac m2 and I’m using MATLAB version 2023b. I’ve placed Dynare in the ‘Applications’ folder, and I added the path using the command:

addpath(‘/applications/Dynare/5.5/matlab’)

However, when I try to run example 1, MATLAB reports the following error:

Unrecognized function or variable ‘num_procs’.
Error in default_option_values (line 72)
options_.threads.kronecker.sparse_hessian_times_B_kronecker_C = num_procs;
Error in global_initialization (line 136)
options_ = default_option_values(M_);
Error in example1.driver (line 24)
global_initialization;
Error in dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);

This error seems to be related to the num_procs variable. I’m not sure what might be causing this issue. I’ve checked the compatibility and set the path correctly. Any guidance on resolving this problem would be greatly appreciated. Thanks!

That message appears if the mex-files are not present or cannot be located. @wmutschl may know more.

1 Like

Your version of Dynare is not compatible with the MATLAB version due to different architectures.

That is, you have installed the Apple Silicon version of MATLAB, check this in MATLAB:

mexext

It will be mexmaca64 for arm64 (Apple Silicon native) or mexmaci64 for x86_64. According to this you need to download the right version of Dynare, either for arm64 or for x86_64. Hope that helps!

1 Like

Great, I appreciate your assistance. I have one more question: every time I launch Matlab and attempt to execute a code, I encounter the error message “Unrecognized function or variable ‘dynare’.” However, if I include the ‘addpath’ command before running the code, it functions correctly. Can you help me understand why this is happening?

This is expected as Dynare is not built into MATLAB, but a toolbox for MATLAB. So you need to make MATLAB aware of it by using the addpath command. You can globally add the path so it will be added to MATLAB automatically at every restart, see the “Via the menu entries:” explanation here:
https://www.dynare.org/manual/installation-and-configuration.html#configuration

1 Like