octave-maintainers
[Top][All Lists]
Advanced

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

Re: Multiple DLD function in a single .cc file


From: Carnë Draug
Subject: Re: Multiple DLD function in a single .cc file
Date: Thu, 27 Jun 2013 18:54:00 +0200

On 27 June 2013 15:03, Marco Vassallo <address@hidden> wrote:
> Hi everyone,
>
> I would like to put more then one DLD function in a single .cc file,
> and later being able to call them from Octave.
> At the moment I'm using soft link with the command
>
> ln -s target_file.oct my_function_1.oct
> ln -s target_file.oct my_function_2.oct
>
> but I was wondering if there is a better (and possibly automated way)
> for doing it.

There is no issue with having more than one function in a single oct
file. This was the last thing I meant to show you yesterday but didn't
had time. You can place all of your dolphin code in a single .cc file
and have it compiled into a single oct file.

What you will need to do then is tell Octave about it (see help text
for autoload). For a package, you can then either have a PKG_ADD file
at the root of the package (same directory where you have
DESCRIPTION), or you can have PKG_ADD comments on C+ the source (when
the package is installed, it will scan the source for this comments
and automatically generate the PKG_ADD file) [1].

For example, see the partint.cc file[2] in the miscellaneous
package[3] which defines both partcnt and partint. Here, a PKG_ADD
file is being used. I'd prefer to use PKG_ADD and PKG_DEL comments  on
the source but that's a choice left to the maintainer.

Carnë

[1] 
http://www.gnu.org/software/octave/doc/interpreter/PKG_005fADD-and-PKG_005fDEL-Directives.html
[2] 
https://sourceforge.net/p/octave/code/HEAD/tree/trunk/octave-forge/main/miscellaneous/src/partint.cc
[3] 
https://sourceforge.net/p/octave/code/HEAD/tree/trunk/octave-forge/main/miscellaneous/src/


reply via email to

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