bugGNU Octave - Bugs: bug #53099, mkoctfile confused by unknown...

 
 

bug #53099: mkoctfile confused by unknown options followed by source file arguments

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

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 28 Oct 2018 06:11:38 PM UTC, comment #12: 

I think I hit a different version of the original problem when trying to build image-2.8.1 with octave 4.4.1 on cygwin.  I missed to note the problem before but it was also present.

The problem does not appear on normal pkg install but only on buildbot-like enviroment that produces invocation with very long list of argument to mkoctfile.

Failing case: instead of producing a conndef.oct a connectivity.oct is requested to g++



/usr/bin/mkoctfile-4.4.1.exe --verbose  -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova0/octave-image-2.8.1-1.x86_64/build=/usr/src/debug/octave-image-2.8.1-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova0/octave-image-2.8.1-1.x86_64/src/image-2.8.1=/usr/src/debug/octave-image-2.8.1-1 conndef.cc connectivity.o

g++ -I/usr/include/octave-4.4.1/octave/.. -I/usr/include/octave-4.4.1/octave   -fopenmp -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova0/octave-image-2.8.1-1.x86_64/build=/usr/src/debug/octave-image-2.8.1-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova0/octave-image-2.8.1-1.x86_64/src/image-2.8.1=/usr/src/debug/octave-image-2.8.1-1 -shared  -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova0/octave-image-2.8.1-1.x86_64/build=/usr/src/debug/octave-image-2.8.1-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova0/octave-image-2.8.1-1.x86_64/src/image-2.8.1=/usr/src/debug/octave-image-2.8.1-1 conndef.cc -o connectivity.oct  connectivity.o   -L/usr/lib/octave/4.4.1 -loctinterp -loctave



Workaround: a simple `-v` is added to the invocation


/usr/bin/mkoctfile-4.4.1.exe --verbose  -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova2/octave-image-2.8.1-1.x86_64/build=/usr/src/debug/octave-image-2.8.1-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova2/octave-image-2.8.1-1.x86_64/src/image-2.8.1=/usr/src/debug/octave-image-2.8.1-1 -v conndef.cc connectivity.o

g++ -I/usr/include/octave-4.4.1/octave/.. -I/usr/include/octave-4.4.1/octave   -fopenmp -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova2/octave-image-2.8.1-1.x86_64/build=/usr/src/debug/octave-image-2.8.1-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova2/octave-image-2.8.1-1.x86_64/src/image-2.8.1=/usr/src/debug/octave-image-2.8.1-1 -shared  -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova2/octave-image-2.8.1-1.x86_64/build=/usr/src/debug/octave-image-2.8.1-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/octave-forge/prova-image/prova2/octave-image-2.8.1-1.x86_64/src/image-2.8.1=/usr/src/debug/octave-image-2.8.1-1 -o conndef.oct  connectivity.o conndef.o   -L/usr/lib/octave/4.4.1 -loctinterp -loctave
-----

marco atzeri <matzeri>
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>
Group 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>
Group Member
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>
Group 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>
Group Member
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>
Group administrator
Sun 11 Feb 2018 06:49:06 PM UTC, comment #6: 

I think the change 298c6a6bd869 should be reconsidered.

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

Changing title, to reflect the real problem

Avinoam Kalma <avinoam>
Group 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>
Group Member
Sat 10 Feb 2018 06:01:13 PM UTC, comment #3: 
John Donoghue <lostbard>
Group 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>
Group 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>
Group 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:


>> pkg install -verbose image-2.6.2.tar.gz
mkdir (C:\Users\Avinoam\AppData\Local\Temp\oct-eDmRgh)
untar (image-2.6.2.tar.gz, C:\Users\ Avinoam \AppData\Local\Temp\oct-eDmRgh)
copyfile C:\Users\Avinoam\AppData\Local\Temp\oct-eDmRgh\image-2.6.2\src\connectivity.oct C:\Users\Avinoam\AppData\Local\Temp\oct-eDmRgh\image-2.6.2\src\strel.oct C:\Users\Avinoam\AppData\Local\Temp\oct-eDmRgh\image-2.6.2\inst\x86_64-w64-mingw32-api-v51+
For information about changes from previous versions of the image package, run 'news image'.
>> test stdfilt
????? stdfilt does not exist in path
>> pkg load image
>> test stdfilt
***** test
im = stdfilt (ones (5));
assert (im, zeros (5));
!!!!! test failed
'__spatial_filtering__' undefined near line 71 column 12


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>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Carbon-Copy List
  • -email is unavailable- added by matzeri (Posted a comment)
  • -email is unavailable- added by rik5 (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
  •  

    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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-30 mtmiller Carbon-CopyRemoved 80942 -
    2018-06-13 mtmiller StatusNone Confirmed
        Summarymkoctfile does not accept -O2 mkoctfile confused by unknown options followed by source file arguments
    2018-06-13 mtmiller Dependencies- bugs #54112 is dependent
    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.13-4448.
    Corresponding source code