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?
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: 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: *** [BlockDiagonal.o] Error 1
make: 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.
[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
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
-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.
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:
I replaced mwSize with int in SylvParams.cpp and gensylv.cpp (this might generate problems with some Dynare functions I have not yet used)
Then I ran make in the gensylv/matlab directory and the mexglx file was created.
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,