[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using Octave functions in C environment
From: |
Carlo De Falco |
Subject: |
Re: Using Octave functions in C environment |
Date: |
Tue, 7 Nov 2017 17:08:56 +0000 |
> On 7 Nov 2017, at 16:06, Himaja Kodati <address@hidden> wrote:
>
> Hi,
> I intend to use existing Octave functions (written by me) from a C
> environment.
> From what I have understood, .oct and .mex files are used to do the reverse.
> i.e., use C code in Octave environment.
>
> Kindly help me with the solution
>
> Regards,
> Himaja
Hi,
Octave works well with C++ I'm not sure how to deal with C.
If C++ is OK for you, you have two options.
If you just need to use functons built into liboctave you can
create a standalone executable linking to liboctave as shown here:
http://hg.savannah.gnu.org/hgweb/octave/file/558de6a42ff7/examples/code/standalone.cc
and compile it with
mkoctfile --link-stand-alone
If you need to run interpreted m-files from within your application you can
embed the
interpreter into your application as shown here:
http://hg.savannah.gnu.org/hgweb/octave/file/558de6a42ff7/examples/code/embedded.cc
please be aware that the syntax for embedding the interpreter has changed
really a lot
lately so how to do it depends on the exact version of Octave you are working
with
HTH,
c.