Compiler error with macs

Hi all,

I’m on a MacBook Pro, Apple M1, macOS Ventura 13.6. I am using MATLAB_R2023a (I tried first using MATLAB_R2023b but I got the same problem as this post). And Dynare 5.4. for mac. My computer is up to date with all updates.

When I run Dynare I get the problem

ERROR: You must install gcc-12 on your system before using the use_dll option of Dynare. If using MATLAB, you can do this via the Dynare installation package. If using Octave, you should run brew install gcc-12 in a terminal.

The installation was successful, I have Xcode in my computer, and “mex -setup” returns:

MEX configured to use ‘Xcode with Clang’ for C language compilation.

I have even installed homebrew and gcc-12 in my computer manually, but it didn’t solved the problem.

I have tried the Friday Sep 22 16:38:41 unstable and now it works, although I get a few lines with the following (I don’t know if important or not):

ld: warning: -undefined error is deprecated

Is it safe to keep using the unstable version if it works? I’m happy to provide the codes in a private message if it helps to polish bugs.

Thanks indeed!

@wmutschl may be able to help.

First, yes, you can use the unstable version of it works for you. Just be aware that we might change stuff in the development cycle such that you would need to keep up with the development.

Second, it is weird that you get asked for gcc-12, while we have switched to gcc-13 and also fallback to clang in the unstable version. Without deeper inspection of the commands and logs you have this is hard to debug
Third: last week we changed the compilation infrastructure to meson instead of make, so I guess it is best to start from scratch anyways.
Also because you can compile with R2023b (native as well as Intel) now. The official package for apple silicon will take another week I think, but we are almost there.

So the short term solution: please compile dynare using these instructions (which are soon in the master branch as well) and report back if it worked for you to compile the unstable version:

There is only one major issue: please don’t use the latest Xcode command line tools 15.0, but downgrade to 14.3.1. (you can find instructions online how to get the installation package or write me an email so I can sent it to you).

Thank you so much Willi, I really appreciate this.

Just to add something: I always fallback to Clang with all dynare versions, so I don’t think it’s something specific to the unstable version as I always get that. The funny thing is that I used to be able to run these things in the past and now I get this error with the exact same code (so I upgraded from R2022 to R2023a and b to see whether that would solve it, but it didn’t). I guess this comes from different system upgrades… working with mac has been a challenge so far (I used to be a Windows person), but I hope things will settle soon.

I will keep using the unstable version with this caveats until the native version comes. Thanks so much for all your work and all your help, I appreciate it to the moon!

The error message suggests that you need to install gcc-12 on your system before using the use_dll option of Dynare. However, you mentioned that you’ve already installed gcc-12 and configured mex to use Xcode with Clang for C language compilation.