octave-maintainers
[Top][All Lists]
Advanced

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

Re: MathGL graphics for Octave


From: Xavier Delacour
Subject: Re: MathGL graphics for Octave
Date: Mon, 6 Oct 2008 20:56:33 -0400

On Sat, Oct 4, 2008 at 4:33 PM, Alexey Balakin
<address@hidden> wrote:
> Hi,
>
> I write a nice scientific graphics library MathGL
> (http://mathgl.sourceforge.net/) and now it have interface for other
> languages via SWIG library. SWIG support the Octave language too.
> Unfortunately I have no ability (qualification and time) to test it
> under Octave :(. So if you are interested in advanced graphics for
> Octave or require some features then contact me. The version with SWIG
> is available at Sourceforge SVN
> (https://mathgl.svn.sourceforge.net/svnroot/mathgl).

I'm not sure I want to own these bindings, but I spent a little while
porting them. The attached patch against your tree hacks the build
system to run swig for octave and build a binary octave package. That
yields mathgl.tar.gz, which can be installed and used as normal,

~/mathgl/lang$ LD_LIBRARY_PATH=../inst/lib:$LD_LIBRARY_PATH octave -q
octave:1> pkg install ./mathgl.tar.gz
octave:2> pkg list
Package Name  | Version | Installation directory
--------------+---------+-----------------------
      mathgl *|   1.0.0 | /home/x/octave/mathgl-1.0.0
octave:3> help mgl_tube_xyzr
 -- Loadable Function: mgl_tube_xyzr (GRAPH, X, Y, Z, R, PEN)
     GRAPH is of type HMGL. X is of type HMDT. Y is of type HMDT. Z is
     of type HMDT. R is of type HMDT. PEN is of type char.

mgl_tube_xyzr is a built-in function

.
.
.

There isn't anything specific to python in what you have so far (e.g.,
special typemaps). Making them work is really just a matter of giving
swig the -octave -c++ options.

The only problem I ran into was that you feed swig a C++ header with
default arguments, but then feed the generated code the C header with
no default args. The octave backend generates code assuming the
default args, whereas python always gives all arguments (copying the
defaults). I removed the defaults from mgl_base.i, but you could leave
them in and compile w/ a C++ header.. then they would work from within
octave.

Xavier


>
> All the best,
> Alexey Balakin
>

Attachment: mathgl-octave.diff.gz
Description: GNU Zip compressed data


reply via email to

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