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

 
 

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

Submitted by:  None
Submitted on:  Fri 27 Jan 2017 08:34:23 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: MakhnoOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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:

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>
Project Member
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>
Project 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:

Markus Mützel <mmuetzel>
Project Member
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.

Rik <rik5>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 29 Jan 2017 12:39:53 AM UTCrik5CategoryOctave Function=>Octave Forge 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.1-cleanup1