Hi George,
the mexPrintf in the DLL give misleading information, because of output buffering. They may not appear on the Matlab screen even if the bug is after their position in the code.
I have it now working in Matlab 7.4 (r2007a) with cygwin (gcc-3 -mno-cygwin).
My last problem was to have the <file_name>_dynamic DLL created with Dynamic among the export names. I was able to hack gnumex installation in order to do it,
However, I still don't know which simple solution, we can suggest for people to install a compiler to make Mex file from Matlab and have the Dynamic function visible. Trying to find a solution, I found that gnumex was again out of date and is confused by the cohabitation of gcc-3 and gcc-4 in current Cygwin install. Visual C++ express 2008 is too recent for older Matlab versions. Maybe the hacked mexpopts.bat that I made for Cygwin a couple of years ago is a temporary solution.
In summary: 1) add -D_WIN32 in the build system for Windows/Cygwin 2) find a solution for compiling the users' DLL (<fname>_dynamic.c) under Windows
Best,
Michel
G. Perendia wrote:
PS This find helps to locate place of crash closer as the crash thus seems to happen before loading model_dynamic.dll, in preamble of k_order_perturbation.cpp.
There is DynareMxArrayToString() being called before creating Dynamic DLL class and that function seem to have been pretty modified in meantime .
My old version of DLL (using old version of DynareMxArrayToString() works fine. However, all of the #ifdef DEBUG ... statements used for debugging DLL run under Matlab are also removed from the new code so it is now difficult to point to the place of the crash more precisely.
I will investigate this crash further
----- Original Message ----- From: "G. Perendia" george@perendia.orangehome.co.uk To: "List for Dynare developers" dev@dynare.org Sent: Saturday, December 05, 2009 4:54 PM Subject: Re: [DynareDev] k_order_perturbation under Windows
Dear Michel
Thanks for pointing that missing definition: -D_WIN32 is indeed needed
for
successful compilation of dynamic_dll.cpp under windows so it should be defined by the Makefile
However, adding that definition and recompiling dynamic_dll for new
instance
of k_order_perturbation did not help on my machine under Matlab.
Best regards
George
----- Original Message ----- From: "Michel Juillard" michel.juillard@ens.fr To: "List for Dynare developers" dev@dynare.org Sent: Saturday, December 05, 2009 3:32 PM Subject: [DynareDev] k_order_perturbation under Windows
k_order_perturbation DLL works under Windows XP and Octave when compiled under Cygwin (with gcc-4), but it is necessary to add -D_WIN32 when compiling, in order to avoid the dlopen/dlclose functions. If these functions are present, Octave refuses to load the DLL.
I'm going to check with Matlab now
Best
Michel
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev