Finding function locations

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding function locations

Vishnu Parammal
Hi Sir, 
I am new to octave contribution community. I have gone through the bug section and there are some that I think I can solve. But I am finding it difficult to get the exact locations where functions are defined. For e.g. bug https://savannah.gnu.org/bugs/?57870. Where do I find the mod() function?  
Reply | Threaded
Open this post in threaded view
|

Re: Finding function locations

John W. Eaton
Administrator
On 3/13/20 3:42 AM, Vishnu Parammal wrote:
> Hi Sir,
> I am new to octave contribution community. I have gone through the bug
> section and there are some that I think I can solve. But I am finding it
> difficult to get the exact locations where functions are defined. For
> e.g. bug https://savannah.gnu.org/bugs/?57870. Where do I find the mod()
> function?

octave:1> help mod
'mod' is a built-in function from the file libinterp/corefcn/data.cc

  -- mod (X, Y)
      Compute the modulo of X and Y.
  ...

jwe

Reply | Threaded
Open this post in threaded view
|

Re: Finding function locations

nrjank
In reply to this post by Vishnu Parammal
On Fri, Mar 13, 2020 at 10:35 AM Vishnu Parammal <[hidden email]> wrote:
Hi Sir, 
I am new to octave contribution community. I have gone through the bug section and there are some that I think I can solve. But I am finding it difficult to get the exact locations where functions are defined. For e.g. bug https://savannah.gnu.org/bugs/?57870. Where do I find the mod() function?  

Thanks for coming on board! A few things:

to answer your immediate question: you can find the location of any function within the Octave installation using 'which'.
>> which mod
'mod' is a built-in function from the file libinterp/corefcn/data.cc

This tells you that mod is a compiled function.  to work on the bug you'll need to be comfortable working in C++, and you'll have to work on the source code directly. (many other functions are written directly in m-code which can be more accessible for some people familiar with Matlab/Octave but not 'real programming'.) that leads to the following question:

Are you set up to work with the Octave source code?  We manage it using a Mercurial version control software, and is the best way to work on the latest version of code and prepare patches for inclusion.  

You can find instructions on getting started here: