Computation speed of Dynare_v4 on Linux


I’ve installed Dynare_v4 on Linux (Kubuntu feisty). Unfortunatly it is way too slow in computing second order soulutions compared to the Windows version.

I guess this is due to the missing mex functions (see Michel’s message on installing Dynare_v4 on Linux)

It would be great to have scripts (instructions) that can be executed (followed) to compile the mex functions on Matlab for Linux. Is this possible?



Hi Gianni,

look at the attached tar file. You should do ‘make’ in gensylv/matlab and then copy gnesylv.mexglx to dynareXXX/matlab

Tell me if it works for you.


gensylv_mex.tar.gz (155 KB)


unfortunately typing ‘make’ was not enough to generate the mex files for LINUX.

Here is the error message

make EXTERN_DEFS="-DMATLAB" -C …/cc BlockDiagonal.o
make[1]: Entering directory `/home/lombardo/gianni/temp_gensylv/gensylv/cc’
mex -c -DMATLAB -c BlockDiagonal.cpp
eval: 1: -c: not found

mex: compile of 'BlockDiagonal.cpp' failed.

make[1]: *** [BlockDiagonal.o] Error 1
make[1]: Leaving directory `/home/lombardo/gianni/temp_gensylv/gensylv/cc’
make: *** …/cc/BlockDiagonal.o] Error 2

Am I missing something?




sorry, I take back what I posted a minute ago.
The mex -setup was not done properly.

Now make produces few steps. Then a complaint about the type of a variable stops the process.
I get

[quote]SylvParams.cpp:167: error: ‘mwSize’ does not name a type.


I’m trying to generate the mexglx file using the instructions given by Michel.

It does not seem to work on my installation of Linux.

First I had problems with the mxSize type. Then I changed it to int (just to bypass the problem. I had to do this both in SylvParams.cpp and in gensylv.cpp.

I got the following (after apparently compiling some stuff

Could it be possible to have Michel’s file??



Hi Gianni,

-I believe that the MxSize problem comes from the fact that you have an older verson of Matlab
-my is the standard one provided my Matlab on Linux for compiling with gcc
-the problem with you libm library seems to me to be related to your installation. I interpret the error message as your lim\ isn’t in sync with your ld loader
On Debian, is provided by package libc6-dev. Be careful, when I tried Ubuntu a while ago, I wasn’t able to update gcc and libc without making a complete mess of the system. Since then, I stick to Debian.

Good luck



Thanks Michel for your reply,

I think I solved the problem(for now). My last message about the lm libraries was due to an incompatibility of some libraries on my 64bit machine with those required by the makefile.

I have tried on my 32Bit laptop and everything seems to work after a few changes to the .cpp files. This is a workaround that might bring up problems in the future, though…

In any case, for those that want to try:

  1. I replaced mwSize with int in SylvParams.cpp and gensylv.cpp (this might generate problems with some Dynare functions I have not yet used)

  2. Then I ran make in the gensylv/matlab directory and the mexglx file was created.

  3. I moved it into dynare_v4/matlab and… second order solutions seem to work fine.

Maybe last question: does anybody know if replacing mwSize with int cause any problem?

Thanks again to Michel,


Two things

  1. the lm incompatibility is between gcc and libc6 files installed on your 64 bit machine, not with the Makefile
  2. mwSize seems to have been introduced in Matlab version 7.3 for 64 bit Matlab, it is defined as size_t, for 32 bit Matlab and before 7.3, mwSize should be set to int. So changing it to int won’t create problem. I will try to get a fix, so that users don’t have to change it in the future