[Testers Wanted] Release of Dynare 5.5-beta and 6.0-beta for Apple Silicon (M1/M2 chips)

We now provide native pkg installers for the unstable version of Dynare and for Dynare 5.5.
Thanks to all!

[UPDATED!]

Dear users,

MATLAB has finally released an Apple Silicon version (R2023b), so we are preparing native Apple Silicon packages of Dynare.
Currently, I am the only member of the team with an Apple Silicon machine and therefore I would like other uses with M1 or M2 machines to test the compiled pkg. For this you have to:

  1. Install MATLAB R2023b for Apple Silicon following the the official instructions.
    We recommend, but don’t require, the following: Optimization, Global Optimization, Statistics and Machine Learning, Econometrics, and Control System.
    You can check the architecture of your MATLAB by running the following MATLAB command:
mexext

If you get mexmaca64 you are running Apple Silicon (arm64), if you get mexmaci64 you are running Intel on Rosetta2 (x86_64).

  1. Download and install one of the following packages (THESE ARE BETA!!!):

Remember that you need to right click - Open to install it. Please read the welcome screen and the post-installation recommendations.

  1. It would be nice if you would also test the x86_64 version with MATLAB (Intel version):

Remember that you need to right click - Open to install it. Please read the welcome screen and the post-installation recommendations.

  1. Try running your mod files.

  2. If everything works, like this post by clicking on the heart. Otherwise, please report errors or weird behavior below.

Thank you!

3 Likes

Hi Willi,

I have a Mac with Apple silicon and would like to serve as a tester for ARM64 native Dynare version. I have some questions about how best to proceed:

  1. I have installed MATLAB R2023a, which I understand still runs using Rosetta 2. Does that matter, or should I get the R2022a beta version specifically since it is the open beta for Apple silicon?
  2. Is there a later beta package available that I should use to test? It appears that the links here correspond to Dynare v5.1 and v5.2. If there is a later beta version available, I am happy to test that too.
  3. My .mod files use the Statistics and Machine Learning toolbox. Will that be a problem?

Let me know, and I’ll report back with my experience. Thank you to you and the Dynare team for all your work on this!

Hey, @wmutschl, Matlab released the ‘‘R2023b prerelease’’ on June 14, which directly supports Apple chips (m-series) and does not require Rosetta 2, and has many more Toolboxes than the 2022 beta version, including “optimization” and “Global Optimization”. I tested “dynare-5.2-beta-arm54.pkg” running ‘‘example3.mod’’ and found that it successfully solved the optimization problem. Although the toolbox is still being tested, we can now use the ‘‘fsolve’’ command…Awesome!

1 Like

Many thanks for the heads up! We will publish official Dynare versions for Apple silicon soon.

Let’s look forward to it together! : D

Seconded! Just ran my mod files (which call fsolve) with 5.2-beta pkg and the 2023b prerelease version. Worked like a charm! Looking forward to the official release!

The final version of R2023b for Apple Silicon is available. I have updated the first post, please test the new packages and report weird behavior. The progress of official packages can be followed in this merge request.

So happy to hear that you are developing a native apple silicon dynare!

I installed the official apple silicon MATLAB R2023b and dynare 6.0 pkg for MacOS arm64, which you linked to above.
However, I experienced an error on the first attempt to run my mod file:
“Unrecognized function or variable ‘num_procs’.”
Hope this helps your development!

Thank you for this feedback. Do you have numprocs anywhere in your mod file? Feel free to share it here or with me. It is indeed a command not supported on

Could you try out this version:
https://mutschler.eu/files/dynare-macos-pkg/dynare-6-unstable-arm64.pkg
Please read the welcome screen.

No, my mod file didn’t include num_procs.
I had the same error with ramst.mod in the examples.

But with the new version you posted, it works fine!!!

Thank you! I appreciate your feedback very much! We plan to release Dynare 5.5 with native Apple Silicon support very soon, you can follow the progress here

Also one more question: were you asked for an admin password in the installer? I am just asking, because the new installer does not require this, but for some reason in my testing it sometimes did ask for one and I had to specifically click “Only for Me” to overcome this. So I am just curious about your experience.

Gosh, I can’t remember exactly, even though it’s only been a day. But I think I right-clicked on the file, opened it, entered the password, and installed it.

Some notes on the new macOS installer (this information is also given in the welcome and conclusion screens of the pkg installer):

Instructions

  • This installation does not require administrative privileges. If for some reason admin rights are requested, use ‘Change Install Location’ and select ‘Install for me only’.
  • By default Dynare will be installed into /Applications/Dynare. To modify the installation path, click Customize after accepting the license. Then, under Location, select your desired folder.

Troubleshooting with older versions of Dynare

  • Installing into /Applications/Dynare might fail if you have older versions of Dynare installed in /Applications/Dynare. To fix this, modify the ownership by executing the following command in Terminal.app:
sudo chown -R "$USER":staff /Applications/Dynare

Postinstallation Recommendations

Xcode Command Line Tools

Dynare highly benefits from installing Xcode Command Line Tools (an Apple product). To install the Xcode Command Line Tools type the following into Terminal.app:

xcode-select --install

Compilation Environment for use_dll option

Dynare ships a compilation environment that can be used with the use_dll option. To install this environment correctly, the Xcode Command Line Tools are sufficient. Check this by running the following command in the MATLAB command window:

mex -setup

If you get a warning in MATLAB, that Xcode is installed, but its license has not been accepted, run the following command in the terminal:

CLT_VERSION=$(pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version | awk '{print $2}' | cut -d'.' -f1-2)
defaults write com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense "${CLT_VERSION}"
defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense

Moreover, we recommend making use of optimized compilation flags and for this you need to install GCC via Homebrew. Follow https://brew.sh to install Homebrew and then type the following into Terminal.app:

brew install gcc@13

If you already have installed GCC, Dynare will automatically prefer it for use_dll if the binaries are either in /opt/homebrew/bin/gcc-13 (arm64) or in /usr/local/bin/gcc-13 (x86_64). Otherwise, it will fall back to Clang in /usr/bin/clang (for both arm64 and x86_64).