Dynare in Octave

Hello,

I followed the guidelines on the Dynare webpage to get Octave and Dynare using Homebrew. When I run >> octave --force-gui
Octave GNU opens fine but when I run >> dynare example1
it produces the following and stops working:

dynare example1
warning: function /usr/local/Cellar/dynare/4.5.7/lib/dynare/matlab/missing/isfile/isfile.m shadows a core library function
warning: called from
dynare_config at line 146 column 1
dynare at line 63 column 12
warning: function /usr/local/Cellar/dynare/4.5.7/lib/dynare/matlab/missing/ordeig/ordeig.m shadows a core library function
warning: called from
dynare_config at line 146 column 1
dynare at line 63 column 12

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

FYI, example1 runs fine from the terminal. It is probably something that needs to be (re)set for the GNU interface, I guess.

Thank you in advance.

Sincerely,
Amir

I forgot to add that the GNU interface does not open any script either. Maybe >> octave --force-gui
is not the best way to open the GNU interface. Then, I guess my question would be: after installing dynare and octave through Homebrew, how can I work with the Octave GNU instead of the terminal? --Thanks.

Maybe @HoutanBastani knows. He is a Mac user.

1 Like

Hi @asadeghi

Dynare 4.5.7 depends on Octave 4.4.1. My guess is that you have downloaded Octave 5.1.0 as that’s the version currently available in Homebrew. I am looking into how to force the download of Octave 4.4.1 via homebrew at the moment and will respond here with how to do that once know. In the meantime, you can use Dynare 4.5.6 with Octave 4.4.1 by running the following commands at the terminal prompt:

brew uninstall dynare
brew uninstall octave
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout -b octave_for_dynare 0bee75d7193b9e8820318196f2026b91e764eae7
brew install dynare
brew pin octave
git checkout master
brew update

You can then run Octave with the GUI by running

octave --gui

from the terminal prompt

Add dynare to the path by running

addpath /usr/local/opt/dynare/lib/dynare/matlab

from the Octave prompt

Thanks, Houtan Jaan.

I ran the commands you suggested but no improvement.

Amir

Hi Amir,

What do you mean by

the GNU interface does not open any script either

In any case, you should know that Octave is primarily a command-line language. The GUI is a recent development. If it does not work on your computer, this is something you can bring up with the homebrew developers but we do not have control over that. As long as it is running in the terminal and .mod files run correctly, that is, unfortunately, the most I can help you with.

NB: I have the same warnings at the top of the file. They should not impact dynare as we provide certain functionality in case it is not on a user’s computer. I’ll check to see why these files are included in Octave next week.

Thanks, Houtan Jaan,

By GNU I meant GUI and by the script I mean the code. I ran the command you had included–should have all the numbers included in this line: git checkout -b octave_for_dynare 0bee75d7193b9e8820318196f2026b91e764eae7 or just type git checkout -b octave_for_dynare? I ran that line with no numbers at the end.

After Octave and Dynare were reinstalled, I ran octave --gui. It does not open any .mod or .m code and so there is no way for me to work on the code. I can run the .mod file in the terminal but it is not easy to edit the file or a .m file in the terminal environment.

Since Octave GUI does not open a .m file either, there should be a problem with my installation of Octave. It runs the .mod file fine in the terminal.

Thanks again for your help.

Amir

One other important thing. I noticed that after I uninstalled and reinstalled dynare and octave, when I run octave in the terminal, it still comes up as version 5.1.0. I thought what you suggested would downgrade octave to version 4.4.1.

Is there something else I should do, aside from running the lines you suggested?

Thank you,
Amir

Hi,

  1. Without including the numbers at the end of the git checkout command the whole operation was for naught. Please do it again and type each line the way I wrote it above. Each new line should be entered after the previous one has finished running.

  2. Note that you can use any text editor to edit .mod and .m files. It need not be that of Octave/Matlab. The Octave GUI is relatively new and support on Mac is their lowest priority so I wouldn’t be surprised if there were bugs in the GUI. Instead, it might be a chance for you to learn how to use another editor. Personally, I use Emacs (https://emacsformacosx.com/), though this may not be the best editor for you as there’s a steep learning curve. A popular editor on Mac that friends use is Atom (https://atom.io/). I have never used it, but it has a Matlab/Octave mode that will help you with spacing etc. https://atom.io/packages/language-matlab-octave

Thanks. This is very helpful.
This is the message I get when I run that line with all the numbers included: fatal: reference is not a tree: 0bee75d7193b9e8820318196f2026b91e764eae7

I understand this is a git issue. Sorry, I am new to git and mac :slight_smile: I will fix this and let you know if it finally works.

Hi Houtan,

I was able to install Dynare with Octave 4.4.1.

Two things are helpful to point out. First, homebrew apparently does not bring in the full history during installation. My repository was stopped at April 1st. So, I had to clone manually with setting the DEPTH option equal to a larger number so that it would bring in the changes at least until March 13 (the date of the commit). Second, each time that I installed dynare, brew automatically updated itself which then updated octave to the latest version. So, I had to use the NO_AUTO_UPDATE option to prevent the octave upgrade.

It is sad to say that after all this, the octave gui still does not work. I will let you know if I can fix it.

Thanks,
Amir