Dynare MacOS -Unrecognized function or variable 'num_procs'

Hi,

I recently switched to a macbook and trying to run my codes in dynare 5.4 (no GCC installation since it gets stucked). However, I am getting the following message. Since I am not experienced with MacOS at all, do not know what this problem is all about

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 nk.driver (line 24)
global_initialization;

Error in dynare (line 278)
evalin(‘base’,[fname ‘.driver’]);

If you can help me will that issue, I will appreciate. Thanks in advance

That is a mex-file. How did you install Dynare?

Actually, I just realized that I installed the recent 2023b (apple slicon) matlab with dynare 5.4 which are not compatible. so i solved the problem with installing 2023a. my bad, sorry for the confusion.

Note that once the official 2023b version is available, there will be a native Dynare package for Apple Silicon.

I have exactly the same problem, after I installed Matlab 2023b. (the code works well with 2023a).

Should I re-install Dynare 5.4?

But you are pointing to the Windows version while the thread is on Mac. Please clarify.

Hi,

I get the same 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 278)
evalin(‘base’,[fname ‘.driver’]);

I just installed Dynare 5.4 on Matlab 2023b for Mac (Ventura / Apple Silicon via Rosetta 2). Any suggestion on how to make the installation work?

Best

Dynare 5.4 does not support Matlab 2023b on Mac. @wmutschl What do you think?

Thanks for your reply. I’ll wait for your colleague’s response. But then I’ll suggest to edit the installation homepage of dynare for Mac, because it currently says that Dynare 5.4 is compatible with Maltab 2023b.

Best,

We are in the process of releasing Dynare 5.5. which will have native support for Apple Silicon. Also GCC is not required anymore (even though we still recommend it).

With that being said, for me Dynare 5.4. does work on R2023b (Intel), so I am curious what is going on.
Could you sent me the mod file you are using which does not work, so I can double check? Are you sure you installed the Intel version of R2023b? Alternatively, use R2023a for now, until we release Dynare 5.5.

Actually I just ran dynare example1.mod with Dynare 5.4. on MATLAB R2023b (Intel) and it works. I then ran it on MATLAB R2023b (Apple Silicon) and I get the same error:

>> addpath /Applications/Dynare/5.4/matlab
>> dynare example1
Starting Dynare (version 5.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file ...
Found 6 equation(s).
Evaluating expressions...done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs ...
done
Preprocessing completed.

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 278)
    evalin('base',[fname '.driver']);

So I am very positive that you installed the wrong version of MATLAB. Please use the Intel one with Dynare 5.4. You can also have both MATLAB versions installed, e.g. /Applications/MATLAB/arm64/R2023b.app and /Applications/MATLAB/x86_64/R2023b.app

You can check the architecture in MATLAB by running the following command in MATLAB:

mexext

It will return:

  • mexmaca64 if you are on native Apple Silicon (arm64).
  • mexmaci64 if you are using Rosetta 2 (x86_64).

Dear @wmutschl,

Thanks for your replies. I checked the architecture and indeed I am running Matlab for native Apple Silicon. So the issue is resolved. I must wait for Dynare 5.5 to be released for it to be compatible with Matlab 2023b. In the mean time, I’ll follow the alternatives you have suggested of using Matlab 2023b on intel processor.

Best,

Juan

We now have native releases of the unstable version of Dynare on our website.

1 Like

I’m using version R2023b for Mac, with version 5.5 of Dynare and I’m still encountering this problem:
Starting Dynare (version 5.5-arm64).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
Substitution of Expectation operator: added 2 auxiliary variables and equations.
Substitution of endo leads >= 2: added 6 auxiliary variables and equations.
Substitution of endo lags >= 2: added 22 auxiliary variables and equations.
Found 77 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

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 modelo_fiscal.driver (line 24)
global_initialization;

Error in dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);

mexext

mexmaci64

@wmutschl Can you help?

This shows that you are using the native Apple Silicon arm64 version of Dynare.
But when you enter mexext in MATLAB you get

mexmaci64

which shows that you are using the Intel x86_64 version of MATLAB.

So the solution: either install the arm64 version of MATLAB or use the x86_64 version of Dynare.

Thanks for the guidance! Dynare ok.