bugGNU Octave - Bugs: bug #40180, pkg.m: search for mkoctfile etc....

 
 

bug #40180: pkg.m: search for mkoctfile etc. ignores .exe extension on windows

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Fri 04 Oct 2013 08:44:07 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
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

Wed 09 Oct 2013 01:10:28 AM UTC, comment #11: 

Done, closing as requested.

http://hg.savannah.gnu.org/hgweb/octave/rev/6b8df90c8806

When you open the other bug, I already have a comment that the configure failure you are seeing in the windows package fails for me on Linux as well.

Mike Miller <mtmiller>
Group Member
Tue 08 Oct 2013 08:56:52 PM UTC, comment #10: 

Using your patch, packages communications, control, general, image, io, linear-algebra, miscellaneous, optim, signal, specfun. statistics and struct install fine.

After you pushed, please close this bug. I'll open another one then for the failing windows package installation.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 08 Oct 2013 02:05:09 PM UTC, comment #9: 

I already tried patches that are essentially the same. They allow me to install various packages on windows (e.g., general, struct, miscellaneous, statistics, control, io, etc.), and an individual mkoctfile call works a well, so I assume blindly that this changeset will work too. I'd say: just push.

Thank you John and you for fixing this.

But the remaining problem is installation of the windows package. I first thought it might be related to the classdef branch, but it won't install with a recent "default" branch build either.
The window package installed OK (on MXE builds) until shortly before the __hook cs (I just saw it was patch tracker #8177), so I (just) suspect there's a link.
Tonight I'll scutinize in more detail the changelog, for a clue in other changesets since the last build that allowed the windows pkg to install fine.


Philip Nienhuis <philipnienhuis>
Group Member
Tue 08 Oct 2013 11:44:56 AM UTC, comment #8: 

Try the attached changeset please. If you could please try testing a package install as well as a call to the mkoctfile function on a single .cc file for example.

(file #29325)

Mike Miller <mtmiller>
Group Member
Sun 06 Oct 2013 08:36:36 PM UTC, comment #7: 

Trying in the CLI didn't get me much further w.r.t. the windows package installation issue.

I could only assess that the newlines in the 'cmd' variable (created in Ls 66-67 of configure_make.m) are actually CRLF sequences (I guess that's why the contents of variable 'cmd' looked garbled).

Hopefully next Tuesday I'll have time to look into this again.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 06 Oct 2013 07:49:59 PM UTC, comment #6: 

The variable 'octave_binary' also needs an .exe extension as _gripe_missing_component_ checks this executable as well, a few lines lower.
With the patch from comment #2, after fixing this, dropping the "if then else" for the superfluous '.' and trying again, the build_packages script in the MXE Windows build works again- for most packages, see below.
Shall I try to produce a changeset later (I'm on Windows now, I usually cross-build on Linux), or will you, Mike?


However, it turns out that now the windows package doesn't install anymore (it did fine before changeset 17516:21656a949661).

I tried to debug this but didn't get very far; the error messages are:

>> pkg install -verbose windows-1.2.1.tar.gz
mkdir (C:\Users\Philip\AppData\Local\Temp\oct-20)
untar (windows-1.2.1.tar.gz, C:\Users\Philip\AppData\Local\Temp\oct-20)

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for mkoctfile... C:/Octave/octave-3.7.7+_MXE/bin/mkoctfile-3.7.7+.exe
In file included from conftest.cc:2:0:
C:\Octave\octave-3.7.7+_MXE\include\octave-3.7.7+\octave\../octave/version.h:35:8: error: 'string' in namespace 'std' does not name a type
C:\Octave\octave-3.7.7+_MXE\include\octave-3.7.7+\octave\../octave/version.h:37:8: error: 'string' in namespace 'std' does not name a type
C:\Octave\octave-3.7.7+_MXE\include\octave-3.7.7+\octave\../octave/version.h:39:8: error: 'string' in namespace 'std' does not name a type
C:\Octave\octave-3.7.7+_MXE\include\octave-3.7.7+\octave\../octave/version.h:41:8: error: 'string' in namespace 'std' does not name a type
C:\Octave\octave-3.7.7+_MXE\include\octave-3.7.7+\octave\../octave/version.h:43:8: error: 'string' in namespace 'std' does not name a type
C:\Octave\octave-3.7.7+_MXE\include\octave-3.7.7+\octave\../octave/version.h:47:8: error: 'string' in namespace 'std' does not name a type
C:\Octave\octave-3.7.7+_MXE\include\octave-3.7.7+\octave\../octave/version.h:51:8: error: 'string' in namespace 'std' does not name a type
g++: error: conftest.o: No such file or directory
configure: error: Could not run C:/Octave/octave-3.7.7+_MXE/bin/mkoctfile-3.7.7+.exe
status =  1
output =

pkg: error running the configure script for windows.
error: called from 'configure_make' in file C:\Octave\octave-3.7.7+_MXE\share\octave\3.7.7+\m\pkg\private\configure_make.m near line 72, column 9
error: called from:
error:   C:\Octave\octave-3.7.7+_MXE\share\octave\3.7.7+\m\pkg\private\install.m at line 199, column 5
error:   C:\Octave\octave-3.7.7+_MXE\share\octave\3.7.7+\m\pkg\pkg.m at line 394, column 9
>>


The above compile errors are a red herring. The actual error is with the configure command.
I got only as far as assessing that the variable 'cmd' cooked up in lines 66-67 of ..../pkg/private/configure_make.m seems to contain a number of newlines inserted at the end (clearly distinguishable from line wrap):

cmd = cd 'C:\Users\Philip\AppData\Local\Temp\oct-20\Windows\src'; MKOCTFILE="C:\Octave\octave-3.7.7+_MXE\bin\mkoctfile-3.7.7+.exe" OCTAVE_CONFIG="C:\Octave\octave-3.7.7+_MXE\bin\octave-config-3.7.7+.exe" OCTAVE="C:\Octave\octave-3.7.7+_MXE\bin\octave-3.7.7+.exe" INSTALLDIR="C:\Octave\octave-3.7.7+_MXE\share\octave\packages\windows-1.2.1" ./configure --prefix="C:\Octave\octave-3.7.7+_MXE\share\octave\packages\windows-1.2.1"
 CC="gcc
" CXX="g++
" AR="ar
" RANLIB="ranlib
"


Discerning where these newlines come from proved undoable for me; a stumbling block I hit (while stepping through configure_make) was that this 'cmd' variable was garbled at the end in my Octave GUI terminal (maybe a separate issue).

(The windows pkg install issue is reported here because I suppose it is related to changeset 17516:21656a949661)

Philip Nienhuis <philipnienhuis>
Group Member
Sat 05 Oct 2013 12:33:53 AM UTC, comment #5: 

Oh, yeah, I guess it does include the ".".  In that case it is even easier to fix.

John W. Eaton <jwe>
Group administrator
Fri 04 Oct 2013 10:42:27 PM UTC, comment #4: 

Thanks for whipping out that patch so fast.

The mkoctfile.m function needs the same fix as well.

I haven't tested (I can't test actually) but isn't the extra "." redundant? IIRC EXEEXT is ".exe" on windows, not just "exe".

Mike Miller <mtmiller>
Group Member
Fri 04 Oct 2013 10:27:42 PM UTC, comment #3: 

Another thing is that I think we should only have one version of these files.  If we have to use compiled programs on some systems, then we should probably use compiled programs on all systems to avoid duplication.  It's kind of a maintenance hassle to have to modify two programs when you want to make a change.

John W. Eaton <jwe>
Group administrator
Fri 04 Oct 2013 10:25:40 PM UTC, comment #2: 

How about something like the attached change?  I don't think you have to look for both.  EXEEXT is only set on systems like Windows, and Windows uses the compiled versions.

(file #29297)

John W. Eaton <jwe>
Group administrator
Fri 04 Oct 2013 10:14:59 PM UTC, comment #1: 

Yeah, apologies, I'll work on a patch for this as soon as I can.

The right way to check the executable extension is with


octave_config_info ("EXEEXT")


For mkoctfile and octave-config, I suppose it should check for both, the name with and without EXEEXT, since they both exist as either shell scripts or compiled programs.

Mike Miller <mtmiller>
Group Member
Fri 04 Oct 2013 08:44:07 PM UTC, original submission:  

(Not sure whether this is "configuration and build system" or "Octave function")

changeset 17516:21656a949661 (containing patches for missing Octave components) introduced a number of adaptations for finding executables like mkoctfile, octave_config_info etc.

Now, in a typical section in ./scripts/.../pkg/private/configure_make:

:
    octave_bindir = octave_config_info ("bindir");
    ver = version ();
    mkoctfile_program = fullfile (octave_bindir, sprintf ("mkoctfile-%s", ver));
    octave_config_program = fullfile (octave_bindir, sprintf ("octave-config-%s", ver));
    octave_binary = fullfile (octave_bindir, sprintf ("octave-%s", ver));
:
<snip>
:
    if (! exist (mkoctfile_program, "file"))
      _gripe_missing_component_ ("pkg", "mkoctfile");

...the if (! exist.....) clause is false because on Windows mkoctfile, octave and octave_config_info executables have .exe file name extensions. This isn't honoured in the stanzas higher up where the full paths to these files are constructed.

This also happens in mkoctfile.m and many other files.
I have no idea how and where to easily handle this. Use the "ispc" function and if true, pad ".exe" after the fullfile statements? Would that work on MXE cross-builds?

Anyway this changeset effectively blocks building binary octave-forge packages, and invoking mkoctfile.

Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #29325:  ext.diff added by mtmiller (2KiB - text/x-patch)
file #29297:  diffs.txt added by jwe (986B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-09 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2013-10-08 mtmiller Attached File- Added ext.diff, #29325
    2013-10-04 mtmiller Assigned tomtmiller None
    2013-10-04 jwe Attached File- Added diffs.txt, #29297
    2013-10-04 mtmiller StatusNone Confirmed
        Assigned toNone mtmiller

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code