octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59597] bogus result returned by mexCallMATLAB


From: Sébastien Villemot
Subject: [Octave-bug-tracker] [bug #59597] bogus result returned by mexCallMATLAB
Date: Tue, 8 Dec 2020 09:44:21 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #16, bug #59597 (project octave):

[comment #13 commentaire #13 :]

> So we can rule out whether this problem is due to the MEX interface or some
other problem with the interpreter itself, can you replace the MEX function
with a .oct file that does the same job?

The full source of the MEX is there:
https://git.dynare.org/Dynare/dynare/-/tree/master/mex/sources/perfect_foresight_problem
As you can see, rewriting it as an .oct file is not a straightforward task.

> Or, can you provide complete instructions for how to trigger the problem
with Dynare, the way you originally discovered it?  If I could reproduce the
problem, then maybe I could do the mex/oct file comparison?

Ok, let’s try that.

First you need to install the build dependencies of Dynare. There are many,
and they are listed in this README
<https://git.dynare.org/Dynare/dynare/-/blob/master/README.md#general-instructions>.

Note that if you are on Debian or on a Debian-based system, all dependencies
are packaged, and they are listed in the above README. An even faster way of
installing dependencies is by running `apt build-dep dynare` (note that this
will install Debian-specific stuff that you do not really need, and also the
Debian package for octave).

Then you can do the following:

$ wget https://www.dynare.org/release/source/dynare-4.6.3.tar.xz
$ tar xf dynare-4.6.3.tar.xz
$ cd dynare-4.6.3
$ export OCTAVE_PATH=/path/to/your/local/Octave/6.1.0/copy
$ ./configure --disable-matlab OCTAVE=$OCTAVE_PATH/bin/octave
MKOCTFILE=$OCTAVE_PATH/bin/mkoctfile
$ make -j$(nproc)
$ cd tests/ep
$ $OCTAVE_PATH/bin/octave
> addpath([ pwd '/../../matlab' ])
> dynare rbc


Under Octave 6.1.0, this should fail with:

error: perfect_foresight_problem: nzij_pred should be an int32 matrix with 2
columns


Under Octave 5.2.0, this should succeed.

Note that the m-file that is called via mexCallMATLAB() is actually generated
at run-time. It will be located under `+rbc/dynamic_g1_nz.m`.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59597>

_______________________________________________
  Message posté via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]