bugGNU Octave - Bugs: bug #50165, No Octave-Forge package to match...

 
 

bug #50165: No Octave-Forge package to match Matlab "coder" package

Submitter:  None
Submitted:  Fri 27 Jan 2017 08:34:23 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Makhno Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 05 Mar 2019 07:33:38 PM UTC, comment #7: 

I don't think a request for an entire new toolbox or package is suitable for a bug report. If someone wants to implement a "coder" package, they can certainly do so and it could become part of the Octave Forge repository. But this bug report isn't really actionable. The information will remain here if other users need to work around this specific function.

Mike Miller <mtmiller>
Group Member
Mon 30 Jan 2017 04:18:00 PM UTC, comment #6: 

I'd keep that file out of Matlab's search path in a special folder you only add to Octave's search path. Maybe with something like:

if isempty (ver ('Matlab'))
  addpath ('C:\path_to_the_plus_folder');
end


I never worked with the coder package. But I would guess that the function "varsize" from the Mathworks package writes the values you submit to it to some kind of database.
If the function from comment #3 was in your Matlab search path, it would be used instead of the one from the Mathworks package, effectively inhibiting its effect.

Markus Mützel <mmuetzel>
Group administrator
Sun 29 Jan 2017 09:16:34 PM UTC, comment #5: 

Thanks that works great, and I think I can leave the +coder folder there for Matlab without side-effects.

Anonymous
Sun 29 Jan 2017 08:51:12 PM UTC, comment #4: 

You only need to define the anonymous function once.  Try the solution from Markus in comment #3.  All of your functions will have access to functions on Octave's PATH variable so they can all make use of the single instance of +coder folder with function varsize.m

Rik <rik5>
Group administrator
Sun 29 Jan 2017 04:09:22 PM UTC, comment #3: 

You could also have a function in a "+coder" folder somewhere in your Octave search path with the following content:

function varsize (varargin)
return;
endfunction


Markus Mützel <mmuetzel>
Group administrator
Sun 29 Jan 2017 08:04:43 AM UTC, comment #2: 

How could I make an anonymous function without changing every single function (as almost all have these references)?

Anonymous
Sun 29 Jan 2017 12:39:53 AM UTC, comment #1: 

The function "coder.varsize" belongs to the Matlab package coder.  It is not a core function.  The issue is that there is no equivalent Octave Forge package to replicate that functionality.  I have changed the Category to Octave Forge Package as well as the Summary field.

If you need a temporary workaround, then just define an anonymous function which does nothing.


coder.varsize = @() return;



Rik <rik5>
Group administrator
Fri 27 Jan 2017 08:34:23 PM UTC, original submission:  

One use of Matlab is the autocoding function. Though it is a travesty, it is commonly used in the industry I'm in. It produces surprisingly clear, but horrifically buggy code.
Octave doesn't support autocoding of course, and that's not the problem here. The problem here is that many scripts that are destined for autocoding but also are used in regular Matlab have 'coder' references that direct the autocoder to generate appropriate code. These coder references, like for example

coder.varsize('some_var',[6,1],[0,1]);

are ignored when regular Matlab is running.

Unfortunately, Octave does not ignore these coder references and stops with an error. This makes it difficult to produce mutually compatible code.


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-05 mtmiller StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2017-01-29 rik5 CategoryOctave Function Octave Package
        StatusNone Confirmed
        Release4.0.0 dev
        Summarycoder.varsize is not ignored No Octave-Forge package to match Matlab "coder" package

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code