help-octave
[Top][All Lists]
Advanced

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

Re: Can Octave (Matlab code) be added to C++ as a library?


From: Carlo De Falco
Subject: Re: Can Octave (Matlab code) be added to C++ as a library?
Date: Wed, 8 Apr 2020 07:03:58 +0000


> Il giorno 7 apr 2020, alle ore 23:40, evansste <address@hidden> ha scritto:
> 
> The link, about standalone programs, mentions that Octave has an archived
> library file called "liboctave.a".  Where would I find this file?  Here's
> that link, which was posted earlier by siko1056:
> 
> https://octave.org/doc/v5.2.0/Standalone-Programs.html 
> 
> I've written programs in Fortran, and would like to use "ismember" and
> "unique", which are native Octave functions, in my Fortran programs.  I
> already have many of my own Fortran programs stored in an archive file. 
> Could I just include the "liboctave.a" file, along with my own archive file,
> and be able to use Octave's native functions?
> 
> For example, this is how I currently compile a Fortran program so that I may
> use my own Fortran functions in the program:
> 
> caf <fortran_source_file.f08> -o <executable_name_of_source_file>
> fortranlib.a
> 
> If I want to also include Octave's functions would I simply do something
> like:
> 
> caf <fortran_source_file.f08> -o <executable_name_of_source_file>
> fortranlib.a liboctave.a
> 
> I'd love to use native Octave functions in my Fortran programs since doing
> so would prevent me from having to re-write those functions in Fortran. 
> Would this work, and where might I find the "liboctave.a" file?
> 
> Thanks so much for your time.
> 


Some years ago I wrote a short example on the Octave wiki about how to invoke 
Octave liboctave 
methods from a fortran program :

https://wiki.octave.org/Fortran

This was based on an old Octave release so a few adjustments would be needed 
for it to work with
Octave 5.x or 6.x ...

Is this similar to what you had in mind?

c.






reply via email to

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