bugGNU Octave - Bugs: bug #41720, very first compilation of a c-file...

 
 

bug #41720: very first compilation of a c-file with mex - successfull, after using the build function the c-file cannot be recompile

Submitter:  None
Submitted:  Thu 27 Feb 2014 01:09:36 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Wont Fix Assigned to:  None
Originator Name:  Grigorij Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 27 Feb 2014 01:40:41 PM UTC, comment #1: 

This is a particularity of the Windows file system. When a DLL (a MEX or OCT file is actually a Win32 DLL) is opened by a process, it is locked and cannot be deleted.

By executing the MEX file, it has been loaded by octave and cannot be deleted or overwritten. If you "clear hello" before recompiling, it should work.

Closing the bug, as I don't think we want to do anything about it at octave-level.

Michael Goffioul <goffioul>
Thu 27 Feb 2014 01:09:36 PM UTC, original submission:  

example of a c-file:


#include "mex.h"

void
mexFunction (int nlhs, mxArray *plhs[],
             int nrhs, const mxArray *prhs[])
{
  mexPrintf ("Hello, World!\n");

  mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs);
}


commands in octave:


>> mex hello.c %Compilation is successful
>> hello(1,2) %Out is right


Then, in the c-file, a minor change is performed.
command in octave:

>> mex hello.c

The output is as follows:
C:\Program Files (x86)\octave-3.8.0-5-portable\octave-3.8.0\bin/ld.exe: cannot open output file hello.mex: Permission denied
collect2.exe: error: ld returned 1 exit status
warning: mkoctfile exited with failure status

Indeed, the hello.mex cannot be deleted, neither from explorer nor from octave command prompt ("delete hello.mex" ends up in "warning: delete: hello.mex: Permission denied").

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 None (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-27 goffioul StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code