[Top][All Lists]

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

Re: Problems calling functions created with Matwrap

From: Dirk Eddelbuettel
Subject: Re: Problems calling functions created with Matwrap
Date: Wed, 4 Feb 2004 10:19:00 -0600
User-agent: Mutt/1.3.28i

On Wed, Feb 04, 2004 at 05:06:31PM +0100, Marco Gazzoni wrote:
>  I'm using Octave (ver.2.0.16 under Debian ) to develop some methods for

[ That's a pretty old version. 2.0.17 is the last one in the now dormant 2.0
series of Octave. You may want to consider the 2.1.* branch of Octave where
2.1.50 is currently the recommended general-user version. I don't know of
Debian backports, though. ]

>  bio-signal processing.
>  Some algorithm are very time consuming and I have written them in C. Now I
>  need to call the functions from Octave.
>  I have installed Matwrap but I'm not able to run the compiled function from
>  Octave.
>  Then, I have written a very simple test function but it doesn't work.
>  I have a header file test.h with the prototype of the function test:
>  int test(int);
>  And the source file:
>  int test(int val)
>  {
>      val= val*2;
>      return(val);
>  }
>  To create the needed interface and the library I use the following
> commands:
>  matwrap -language octave test.h -o -stub
>  mkoctfile -lm
>  All seems to work well and no error messages are diaplayed. The following
>  files are created:
>  Test.m,,, test_octave.o, test_octave.oct
>  When I open Octave and I run "test" from the command line Octave crashes.
>  Where is the problem? Someone has some suggestions?

It's been a while, but I have used matwrap with success. Right now, I can
only recommend the following:

a) start from examples, e.g. the demos included in matwrap
b) expand those examples to use the data structures you need 
c) add copious debugging info (e.g. when entereing functions)
d) stay away from system names -- test is likely to collide so I'd use
   something like 'mgtest.*'
Hth, Dirk   

The relationship between the computed price and reality is as yet unknown.  
                                             -- From the pac(8) manual page

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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