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

 
 

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

Submitted by:  None
Submitted on:  Sun 08 Sep 2013 12:54:35 AM UTC  
 
Category: Octave FunctionSeverity: 1 - Wish
Priority: 3 - LowItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: WarrenOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: Any

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)

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>
Project 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>
Project Administrator
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>
Project Administrator
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>
Project Administrator
Sun 08 Sep 2013 12:54:35 AM UTC, original submission:

MATLAB's "mex" command accepts a "-O" option to turn on optimization:
http://www.mathworks.com/help/matlab/ref/mex.html .
Octave does not accept this option, e.g.
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 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 rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by jordigh (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 10 Sep 2016 01:24:09 PM UTCrik5StatusPostponed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 03 Jun 2015 01:35:26 AM UTCmtmillerPriority5 - Normal=>3 - Low
      StatusNone=>Postponed
      Releaseother=>dev
      Operating SystemGNU/Linux=>Any
    Mon 30 Sep 2013 12:57:21 AM UTCmtmillerCategoryNone=>Octave Function
      Severity3 - Normal=>1 - Wish

    Back to the top


    Powered by Savane 3.1-cleanup1