Dynare4.4.3 + octave 4.0.0 + Xubuntu 16.04 LTS


I am using Xubuntu 16.04 LTS and installed dynare and octave to run some DSGE models, using “sudo apt-get install octave” and “sudo apt-get install dynare”

Unfortunately I am hitting an error immediately as I try to run the tutorial files here: dynare.org/documentation-and … t/tutorial

When trying to run “example1.mod” I get an error.

Here is my entire octave session, with errors:

[code]GNU Octave, version 4.0.0
Copyright © 2015 John W. Eaton and others.
This is free software; see the source code for copying conditions.
FITNESS FOR A PARTICULAR PURPOSE. For details, type ‘warranty’.

Octave was configured for “x86_64-pc-linux-gnu”.

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type ‘news’.

dynare example1.mod

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.

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file …
Found 6 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

warning: delete: no such file: example1_static.mex
warning: called from
delete at line 47 column 9
erase_compiled_function at line 23 column 5
example1 at line 77 column 1
dynare at line 188 column 1
warning: delete: no such file: example1_dynamic.mex
error: ‘trans_A’ undefined near line 103 column 7
error: called from
linsolve at line 103 column 3
dyn_first_order_solver at line 264 column 18
stochastic_solvers at line 217 column 18
resol at line 137 column 14
stoch_simul at line 88 column 34
example1 at line 154 column 6
dynare at line 188 column 1


I’ve tried a few other examples with similar results.

I googled the error messages and found this post:

It refers to this issue on github, which appears to just have been closed earlier today: github.com/DynareTeam/dynare/issues/1113

Does this appear to be the same problem? If so, do we know when it might be fixed on Linux?



Dynare 4.4.3 only supports Octave 3.8.1. That is why you are experiencing the problems. The unstable version supports 4.2.1. The problem is that the mex-files have to be built against the Octave version you are using. If you scroll down on github.com/DynareTeam/dynare you will see the description on how to build Dynare from source on Linux.


Update: here are the steps I ran to get Dynare running on my machine, using info from the link provided above. The “$” indicates this was executed on the linux command line, and the “>>” indicates this was executed on the octave command line:

$ sudo apt-get install build-essential gfortran liboctave-dev libboost-graph-dev libgsl0-dev libmatio-dev libslicot-dev libslicot-pic libsuitesparse-dev flex bison autoconf automake texlive texlive-publishers texlive-extra-utils texlive-formats-extra texlive-latex-extra texlive-fonts-extra latex-beamer texinfo texi2html latex2html doxygen pstoedit epstool xfig gnuplot 
$ sudo apt-get install octave
$ cd ~/workspace   # on my machine. You can install wherever you want, just adjust the "addpath" below.
$ git clone --recursive [github.com/DynareTeam/dynare.git](http://github.com/DynareTeam/dynare.git)
$ cd dynare
$ autoreconf -si
$ ./configure
$ make 
$ make html
$ octave
>> addpath ~/workspace/dynare/matlab
>> cd examples
>> dynare example1.mod

This should run the example.

Everything appears to be working. A few examples I’ve found elsewhere have issues, but I will post separately.



I am experiencing the same issue on Ubuntu 16.04 LTS with Octave. Unfortunately, the solution isn’t working for me. I am not able to build Dynare from source.

The command


gives me an error saying that I have to install a more recent version of Octave. The official repositories provide only Octave 4.0 and the error message states that Octave 4.2 is required.

Hence, I added the PPA

sudo add-apt-repository ppa:octave/stable

upgraded to version 4.2.2. and repeated the above steps. After


I get many errors, here is the last bit

In file included from ModelTree.hh:31:0,
from StaticModel.hh:27,
from ModFile.hh:33,
from ParsingDriver.hh:32,
from DynareFlex.ll:25:
DataTree.hh: In member function ‘ExprNode* DataTree::AddUnaryOp(UnaryOpcode, expr_t, int, int, int, const string&, const std::vector&)’:
DataTree.hh:346:128: error: converting to ‘const key_type {aka const std::tuple<ExprNode*, UnaryOpcode, int, int, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::vector<int, std::allocator > >}’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& …) [with _UElements = {ExprNode*&, UnaryOpcode&, int&, int&, int&, const std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, const std::vector<int, std::allocator >&}; = void; _Elements = {ExprNode*, UnaryOpcode, int, int, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::vector<int, std::allocator >}]’
auto it = unary_op_node_map.find({ arg, op_code, arg_exp_info_set, param1_symb_id, param2_symb_id, adl_param_name, adl_lags });
DataTree.hh: In member function ‘ExprNode* DataTree::AddBinaryOp(expr_t, BinaryOpcode, expr_t, int)’:
DataTree.hh:371:77: error: converting to ‘const key_type {aka const std::tuple<ExprNode*, ExprNode*, BinaryOpcode, int>}’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& …) [with _UElements = {ExprNode*&, ExprNode*&, BinaryOpcode&, int&}; = void; _Elements = {ExprNode*, ExprNode*, BinaryOpcode, int}]’
auto it = binary_op_node_map.find({ arg1, arg2, op_code, powerDerivOrder });
DataTree.hh: In member function ‘ExprNode* DataTree::AddTrinaryOp(expr_t, TrinaryOpcode, expr_t, expr_t)’:
DataTree.hh:392:67: error: converting to ‘const key_type {aka const std::tuple<ExprNode*, ExprNode*, ExprNode*, TrinaryOpcode>}’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& …) [with _UElements = {ExprNode*&, ExprNode*&, ExprNode*&, TrinaryOpcode&}; = void; _Elements = {ExprNode*, ExprNode*, ExprNode*, TrinaryOpcode}]’
auto it = trinary_op_node_map.find({ arg1, arg2, arg3, op_code });
DynareFlex.cc: In member function ‘int DynareFlexLexer::yy_get_next_buffer()’:
DynareFlex.cc:9334:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ( number_to_move == YY_MORE_ADJ )
DynareFlex.cc:9351:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
Makefile:572: recipe for target ‘dynare_m-DynareFlex.o’ failed
make[4]: *** [dynare_m-DynareFlex.o] Error 1
make[4]: Leaving directory ‘/home/benjamin/Software/dynare/preprocessor/src’
Makefile:934: recipe for target ‘all-recursive’ failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory ‘/home/benjamin/Software/dynare/preprocessor/src’
Makefile:445: recipe for target ‘all’ failed
make[2]: *** [all] Error 2
make[2]: Leaving directory ‘/home/benjamin/Software/dynare/preprocessor/src’
Makefile:383: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/home/benjamin/Software/dynare/preprocessor’
Makefile:419: recipe for target ‘all-recursive’ failed
make: *** [all-recursive] Error 1

I completely understand that Matlab and Windows compatibility is dominating, but it would be great to work with Dynare and Octave in Ubuntu.



@sebastien may be able to help


@benjamin Which version of Dynare are you trying to compile? I would recommend building the latest stable (4.5.5), unless you really need bleeding edge features.