Computation speed of Dynare_v4 on Linux

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

Computation speed of Dynare_v4 on Linux

Postby lombard » Tue May 15, 2007 7:22 am

Hi,

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?

Cheers,

Gianni
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel

Postby MichelJuillard » Thu May 17, 2007 1:06 pm

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.

Best

Michel
You do not have the required permissions to view the files attached to this post.
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby lombard » Fri May 18, 2007 12:41 pm

Michel,

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?

Thanks

Gianni
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel

Postby lombard » Fri May 18, 2007 1:02 pm

Hi,

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
SylvParams.cpp:167: error: 'mwSize' does not name a type.


Gianni
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel

mexopts.sh file

Postby lombard » Sat May 19, 2007 4:18 pm

HI,
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

mex -I../cc -DMATLAB gensylv.cpp ../cc/sylvester.a
gensylv.cpp:100:3: warning: no newline at end of file
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: cannot find -lm
collect2: ld returned 1 exit status

mex: link of 'gensylv.mexglx' failed.

make: *** [gensylv.mexglx] Error 1


Could it be possible to have Michel's mexopts.sh file??

Cheers

Gianni
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel

Postby MichelJuillard » Sat May 19, 2007 4:34 pm

Hi Gianni,

-I believe that the MxSize problem comes from the fact that you have an older verson of Matlab
-my mexopt.sh 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\bm.so isn't in sync with your ld loader
On Debian, libm.so 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

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

solved

Postby lombard » Sat May 19, 2007 6:35 pm

Hi,

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,

Gianni
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel

Postby MichelJuillard » Sun May 20, 2007 3:16 pm

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

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 1 guest