help-octave
[Top][All Lists]
Advanced

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

Re: Use package in standalone programs


From: Zoltán Szabó
Subject: Re: Use package in standalone programs
Date: Mon, 8 Jan 2018 14:39:23 +0000

Thank you, I will check this out soon.

Is it possible to use an other compiler like gcc and configure it just like what mkoctfile does? Because I might use gcc as my project requests it.

On Mon, Jan 8, 2018 at 1:28 PM, siko1056 <address@hidden> wrote:
Zoltán Szabó wrote
> I am trying to create a small c++ application to execute an octave m file.
>
> So this will be a standalone program as mentioned here:
> https://www.gnu.org/software/octave/doc/v4.0.3/Standalone-Programs.html#Standalone-Programs
>
> My m file is using some functions from the signal package. Is it possible
> to load a package from a standalone program when using octave as a
> library?
>
> Thanks

For the current Octave development version 4.3.0+ it is possible. Do you
need version 4.0.3 or the current stable version 4.2.1? There it seems to
make some trouble.

Using the current Octave development version 4.3.0+ and the interval package
as example:

```
pkg load interval
infsup (1, 2)
   ans = [1, 2]
```

Extending [1] as a start, the above would translate to:

```
octave::feval ("pkg", ovl ("load", "interval"), 0);
octave_value_list out = octave::feval ("infsup", ovl (1, 2), 1);

if (out.length () > 0)
  octave::feval ("disp", out(0), 0);
```

Compiled with:

mkoctfile --link-stand-alone embedded.cc -o embedded

HTH,
Kai

[1]
https://hg.savannah.gnu.org/hgweb/octave/file/cd42d0f341db/examples/code/embedded.cc



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave


reply via email to

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