# Dynare MacOS -Unrecognized function or variable 'num\_procs'

**URL:** https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679
**Category:** Installation and Setup
**Created:** [1 July 2023 16:43 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679 "2023-07-01T16:43:18Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![suecon](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@suecon](https://forum.dynare.org/u/suecon)
#### Post date: [1 July 2023 16:43 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/1 "2023-07-01T16:43:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [3 July 2023 20:07 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/2 "2023-07-03T20:07:16Z")

</div>

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

---

<div class="post-metadata">

### Author: ![suecon](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@suecon](https://forum.dynare.org/u/suecon)
#### Post date: [3 July 2023 20:25 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/3 "2023-07-03T20:25:57Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [4 July 2023 13:26 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/4 "2023-07-04T13:26:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cohenim](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@cohenim](https://forum.dynare.org/u/cohenim)
#### Post date: [26 September 2023 15:43 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/5 "2023-09-26T15:43:48Z")

</div>

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

 ![image](https://forum.dynare.org/uploads/default/original/3X/d/9/d93f9e8cfd58a567408f4f2131655e877edfc9b0.png)

---

<div class="post-metadata">

### Author: ![cohenim](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@cohenim](https://forum.dynare.org/u/cohenim)
#### Post date: [27 September 2023 05:54 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/6 "2023-09-27T05:54:46Z")

</div>

Should I re-install Dynare 5.4?

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [28 September 2023 06:53 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/7 "2023-09-28T06:53:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jparraal](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@jparraal](https://forum.dynare.org/u/jparraal)
#### Post date: [17 October 2023 09:07 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/8 "2023-10-17T09:07:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [17 October 2023 11:59 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/9 "2023-10-17T11:59:58Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jparraal](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@jparraal](https://forum.dynare.org/u/jparraal)
#### Post date: [17 October 2023 13:32 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/10 "2023-10-17T13:32:43Z")

</div>

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,

---

<div class="post-metadata">

### Author: ![wmutschl](https://forum.dynare.org/user_avatar/forum.dynare.org/wmutschl/32/18464_2.png) [@wmutschl](https://forum.dynare.org/u/wmutschl)
#### Post date: [17 October 2023 14:34 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/11 "2023-10-17T14:34:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![wmutschl](https://forum.dynare.org/user_avatar/forum.dynare.org/wmutschl/32/18464_2.png) [@wmutschl](https://forum.dynare.org/u/wmutschl)
#### Post date: [17 October 2023 14:40 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/12 "2023-10-17T14:40:42Z")

</div>

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:

```auto
>> 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

---

<div class="post-metadata">

### Author: ![wmutschl](https://forum.dynare.org/user_avatar/forum.dynare.org/wmutschl/32/18464_2.png) [@wmutschl](https://forum.dynare.org/u/wmutschl)
#### Post date: [17 October 2023 14:43 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/13 "2023-10-17T14:43:42Z")

</div>

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

```auto
mexext

```

It will return:

- `mexmaca64` if you are on native Apple Silicon (arm64).
- `mexmaci64` if you are using Rosetta 2 (x86\_64).

---

<div class="post-metadata">

### Author: ![jparraal](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@jparraal](https://forum.dynare.org/u/jparraal)
#### Post date: [18 October 2023 06:23 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/14 "2023-10-18T06:23:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wmutschl](https://forum.dynare.org/user_avatar/forum.dynare.org/wmutschl/32/18464_2.png) [@wmutschl](https://forum.dynare.org/u/wmutschl)
#### Post date: [18 October 2023 17:14 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/15 "2023-10-18T17:14:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Alfranio](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/b487fb/32.png) [@Alfranio](https://forum.dynare.org/u/Alfranio)
#### Post date: [6 January 2024 08:28 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/16 "2024-01-06T08:28:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [8 January 2024 08:05 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/17 "2024-01-08T08:05:41Z")

</div>

@wmutschl Can you help?

---

<div class="post-metadata">

### Author: ![wmutschl](https://forum.dynare.org/user_avatar/forum.dynare.org/wmutschl/32/18464_2.png) [@wmutschl](https://forum.dynare.org/u/wmutschl)
#### Post date: [8 January 2024 08:25 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/18 "2024-01-08T08:25:04Z")

</div>

> [@Alfranio](#):
>
> Starting Dynare (version 5.5-arm64).

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

```auto
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.

---

<div class="post-metadata">

### Author: ![Alfranio](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/b487fb/32.png) [@Alfranio](https://forum.dynare.org/u/Alfranio)
#### Post date: [8 January 2024 23:48 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/19 "2024-01-08T23:48:26Z")

</div>

Thanks for the guidance! Dynare ok.

---

<div class="post-metadata">

### Author: ![hosey\_29](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/8797f3/32.png) [@hosey\_29](https://forum.dynare.org/u/hosey_29)
#### Post date: [25 May 2025 14:15 UTC](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679/23 "2025-05-25T14:15:14Z")

</div>

I encounter the same issue. I have Matlab 2023b. and downloaded dynare 6.3 arm64. I still get an error. I have MacBook Air M3.

When I type mexext, I get “mexmaci64”  
@jpfeifer

[Next page](https://forum.dynare.org/t/dynare-macos-unrecognized-function-or-variable-num-procs/22679.md?page=2)
