bugGNU Octave - Bugs: bug #53099, mkoctfile does not accept -O2

 
 

bug #53099: mkoctfile does not accept -O2

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Thu 08 Feb 2018 10:05:49 PM UTC  
 
Category:  Configuration and Build System Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Avinoam Open/Closed:  Open
Release:  dev Operating System:  Microsoft Windows

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)

Mon 12 Feb 2018 09:16:28 PM UTC, comment #11:

The buildbots are unhappy so I want to do something to at least temporarily resolve this. I changed mkoctfile to accept '-O' explicitly and NOT to accept an unknown compound option in the final position. (http://hg.savannah.gnu.org/hgweb/octave/rev/9db2f757c7c0).

Rik <rik5>
Project Administrator
Mon 12 Feb 2018 06:42:06 AM UTC, comment #10:

Yeah, I do think like an engineer, and I think reverting 298c6a6bd869 would get us back to working correctly in more use cases than it was meant to fix :)

Mike Miller <mtmiller>
Project Administrator
Mon 12 Feb 2018 02:27:48 AM UTC, comment #9:

I meant the latter interpretation, Unknown options cannot be compound options when located in the final position. This is a restriction, but a small one.

Adding '-O' is a band-aid, but potentially useful. If you think like a scientist or mathematician, the goal is perfection (a system that works correctly in 100% of circumstances). If you think like an engineer, the goal is pragmatism (80% of the scenarios work with 20% of the size of the code that could handle everything.)

I was arguing to do both because -O is a really frequent option ("bang for the buck").

Rik <rik5>
Project Administrator
Sun 11 Feb 2018 10:41:35 PM UTC, comment #8:

Doesn't #2 require parsing argv twice, or some kind of lookahead? Or do you mean only that the compound option is not using the last argument on the argv vector?

I worry that there are far more useful unknown options that don't take arguments than there are unknown options that do take non-file arguments. Adding support for -O* is just a band-aid.

Example 1: mkoctfile -g -pg one.cc two.cc three.cc

This should treat "-g -pg" as options, and compile each of one.cc, two.cc, and three.cc.

Example 2: mkoctfile -isystem /usr/local/include one.cc

This should treat "-isystem /usr/local/include" as an option and compile one.cc.

Mike Miller <mtmiller>
Project Administrator
Sun 11 Feb 2018 09:56:37 PM UTC, comment #7:

Possible strategies, which still allow for unrecognized compound options (bug #52928):

1) Add -O as a recognized option (Heck, this is common enough we might want to do it anyways).

2) Don't allow compound options for the last option. (It is very common practice that the last argument is the file to compile. Use that convention to disallow a compound option as the end).

I don't think we want to completely revert 298c6a6bd869, and the other coding solutions get more esoteric such as parsing the list twice.

Rik <rik5>
Project Administrator
Sun 11 Feb 2018 06:49:06 PM UTC, comment #6:

I think the change 298c6a6bd869 should be reconsidered.

Mike Miller <mtmiller>
Project Administrator
Sun 11 Feb 2018 06:43:34 PM UTC, comment #5:

Changing title, to reflect the real problem

Avinoam Kalma <avinoam>
Project Member
Sun 11 Feb 2018 01:27:43 PM UTC, comment #4:

It is taking any argument after a 'unknown' option as part of the option (in this case the filename) which then will do nothing as there are no files to compile.

Rearranging the args so that the 'unknown' option is not directly preceeding the filename works:

mkoctfile -Wall -O2 -g spatial_filtering.cc

John Donoghue <lostbard>
Project Member
Sat 10 Feb 2018 06:01:13 PM UTC, comment #3:

Broken I believe by this changeset: http://hg.savannah.gnu.org/hgweb/octave/rev/298c6a6bd869

John Donoghue <lostbard>
Project Member
Sat 10 Feb 2018 05:51:58 PM UTC, comment #2:

Running a few different scenarios, and it appears that the -O2 is the failing option.

John Donoghue <lostbard>
Project Member
Sat 10 Feb 2018 05:48:57 PM UTC, comment #1:

I see that on my win10 machine

using the command line, rather than octave, and running configure etc, there are not oct files except the ones you mentioned.

Running manually:

$ mkoctfile -Wall -g -O2 _spatial_filtering_.cc

does not produce an oct file, and appears to return straight away.

Running

$ mkoctfile _spatial_filtering_.cc

does produce the oct file

John Donoghue <lostbard>
Project Member
Thu 08 Feb 2018 10:05:49 PM UTC, original submission:

Trying to install image package on dev version on Win 7 machine, I got:

Note that only connectivity.oct and strel.oct were build, and no other oct file.
Is it a problem of image package or of Octave?
It seems that this an Octave problem, because I saw the same problem with dev version of image package.

Can anyone confirm this?

Avinoam Kalma <avinoam>
Project Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

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 (Posted a comment)
  • -email is unavailable- added by lostbard
  • -email is unavailable- added by lostbard
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by avinoam (Submitted the item)
  • -email is unavailable- added by avinoam
  •  

    Do you think this task is very important?
    If so, you can 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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-11 mtmiller Severity3 - Normal => 4 - Important
    2018-02-11 avinoam SummaryProblem installing image package on dev version => mkoctfile does not accept -O2
    2018-02-11 lostbard Dependencies- => Depends on bugs #52928
    2018-02-11 lostbard Carbon-Copy- => Added rik5
    2018-02-10 lostbard Carbon-Copy- => Added jwe
    2018-02-08 avinoam Carbon-Copy- => Added -email is unavailable-

    Back to the top


    Powered by Savane 3.3