bugGNU Octave - Bugs: bug #39984, MATLAB's mex accepts options not...

 
 

bug #39984: MATLAB's mex accepts options not in Octave's version

Submitter:  None
Submitted:  Sun 08 Sep 2013 12:54:35 AM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Warren Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 10 Sep 2016 01:24:09 PM UTC, comment #6: 

I pushed a fix for this here http://hg.savannah.gnu.org/hgweb/octave/rev/cc4f31e8477f.  Octave now accepts -largeArrayDims and -compatibleArrayDims, bug issues a warning and ignores them.  Octave uses 32-bit or 64-bit indexing based on how Octave itself was built, not how the mex file is built.  Closing report.

Rik <rik5>
Group administrator
Mon 09 Sep 2013 01:14:59 AM UTC, comment #5: 

I'm pointing you to a recent version of the files that need to be patched. It just so happens that this recent version is one where Ben Abbot did some work, unrelated to these files.

Here are some basic and slightly outdated instructions for very basic hg usage:

http://jordi.inversethought.com/blog/how-to-write-a-patch-for-octave/

I really should update those...

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Sun 08 Sep 2013 08:56:19 PM UTC, comment #4: 

Originator here.

I'm new to Mercurial but my reading of those four links is that the latest change is one by Ben Abbott 28 hours ago that has nothing to do with this bug. Did you forget to commit your changes or something? It's also possible that I'm just misunderstanding Mercurial.

Anonymous
Sun 08 Sep 2013 03:46:11 PM UTC, comment #3: 

I'm not gritting my teeth, but you're quite welcome to.

Patches begin here, here, here, and here:

http://hg.savannah.gnu.org/hgweb/octave/file/e04847bbcfdf/scripts/miscellaneous/mex.m

http://hg.savannah.gnu.org/hgweb/octave/file/e04847bbcfdf/scripts/miscellaneous/mkoctfile.m

http://hg.savannah.gnu.org/hgweb/octave/file/e04847bbcfdf/src/mkoctfile.in.sh

http://hg.savannah.gnu.org/hgweb/octave/file/e04847bbcfdf/src/mkoctfile.cc.sh

Also, --traditional will not change the behaviour of the mex command nor anything else, not today nor ever again. It used to do that, but now it only does pointless cosmetic changes, such as changing the prompt.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Sun 08 Sep 2013 02:23:24 PM UTC, comment #2: 

Originator here.

I strongly believe this is the sort of thing you should grit your teeth and fix despite the ugliness of treating a library named "argeArrayDims" specially. The purpose of software is helping users. Beauty is only desirable to the extent that it helps users use the software. It's extremely unlikely that anyone would name a library "argeArrayDims", especially if the special treatment requires --traditional, so the harm of not doing what such a user wants is more theoretical than real. The first time I tried porting a MATLAB program to Octave (about a year ago) I gave up because the combination of the issues in this bug and other incompatibilities led me to believe a successful port would take an unacceptable amount of time.

One possible compromise: if these options are used print a warning message directing the user to documentation explaining how to port installation scripts and C++/fortran mex code to Octave.

Anonymous
Sun 08 Sep 2013 01:25:53 PM UTC, comment #1: 

I am not inclined to consider this a bug. Compiling for Octave is fundamentally different than compiling for Matlab. Furthermore, this is only an issue that arises during "installation". I've seen these installation scripts, and fundamentally they need to be different for Octave. I am less inclined to accept fixes that break existing Octave behaviour, such as using -lfoo for something other than talking to the linker.

The --traditional flag that you're using, by the way, doesn't affect anything significant except minor cosmetic changes. I recommend you stop using it.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Sun 08 Sep 2013 12:54:35 AM UTC, original submission:  

MATLAB's "mex" command accepts a "-O" option to turn on optimization:
    www.mathworks.com/help/matlab/ref/mex.html .
Octave does not accept this option, e.g.

    $ octave --traditional --no-gui --norc -q --eval "mex -O hi.c"
    mkoctfile: unrecognized argument -O
    >>

MATLAB mex's "-largeArrayDims" option has a similar problem: it is allowed but is treated as a linker directive. There's a similar problem with MATLAB's "-output" option: Octave requires "--output" instead. Maybe octave should accept these options but print a warning that they're ignored?

IMHO compatibility is far more important than avoiding the sin of accepting options that violate the convention that multiple character options require two dashes.

I'm using Octave version 3.7.1+. IIRC I built this myself from source around a year ago. I can reproduce with another version if needed.

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 rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by jordigh (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-10 rik5 StatusPostponed Fixed
        Open/ClosedOpen Closed
    2015-06-03 mtmiller Priority5 - Normal 3 - Low
        StatusNone Postponed
        Releaseother dev
        Operating SystemGNU/Linux Any
    2013-09-30 mtmiller CategoryNone Octave Function
        Severity3 - Normal 1 - Wish

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code