bugGNU Octave - Bugs: bug #48511, mxe-octave: mex library...

 
 

bug #48511: mxe-octave: mex library dependencies not picked up

Submitter:  Joris Gillis <jgillis42>
Submitted:  Thu 14 Jul 2016 12:48:26 PM UTC
   
 
Category:  Configuration and Build System Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 23 Nov 2016 01:10:06 AM UTC, comment #4: 

No response.  I'm going to assume jwe's patch fixed this back in July.

Rik <rik5>
Group administrator
Tue 19 Jul 2016 04:19:02 PM UTC, comment #3: 

I checked in the following changeset:

  http://hg.savannah.gnu.org/hgweb/octave/rev/ef91e43f162a

Reading

  https://msdn.microsoft.com/en-us/library/windows/desktop/ms686203%28v=vs.85%29.aspx

it seems that calling SetDllDirectory is all that should be required so that's all the new code in oct-shlib.cc does.  But the previous code in ov-java.cc also called chdir to temporarily set the current working directory.  Could someone test this and determine whether that is actually needed?

John W. Eaton <jwe>
Group administrator
Thu 14 Jul 2016 08:41:55 PM UTC, comment #2: 

There is already code in ov-java.cc that should do what we want:

http://hg.savannah.gnu.org/hgweb/octave/file/d534a3014fd7/libinterp/octave-value/ov-java.cc#l333

It should probably just be added to Octave's dynamic library loading class so that it always happens for Windows DLLs.  I'll take a look at doing that.

John W. Eaton <jwe>
Group administrator
Thu 14 Jul 2016 05:20:20 PM UTC, comment #1: 

Thank you for reporting this feature request. I'm not sure I fully understand dynamic linking on Windows systems, so I can't contribute much to adding this capability. My understanding is that Windows loads dlls from the executable path by default. So if you run a problem in a directory, dlls are searched in that directory, correct? Are they also searched for in the complete PATH environment variable (similarly to the LD_LIBRARY_PATH variable on GNU systems)? Would using setenv("PATH",dir) in Octave be a workaround for this?

If not then please suggest what mechanism would be used on Windows to ensure that the directory containing the .mex file (and probably .oct files as well) gets added to a dynamic load search path.

Mike Miller <mtmiller>
Group Member
Thu 14 Jul 2016 12:48:26 PM UTC, original submission:  

Consider a mex file linked with a dll file, both living in some directory.

After simply addpath-ing the directory, calling the mex file works in Matlab yet fails in Octave.
For Matlab, the loader searches for dlls in the same directory as where the mex file resides.
It would make sense if Octave copied this behaviour.

I'm aware that EXEC_PATH allows Octave to run the mex file, but it just feels cleaner if a binary package can be made available in an Octave session with just one atomic action, an addpath command.

For linux, this is not an issue, since you have the RPATH property for shared libraries there.

Joris Gillis <jgillis42>

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jgillis42 (Submitted the item)
  • -email is unavailable- added by jgillis42
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-23 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2016-07-19 jwe StatusNeed Info Ready For Test
    2016-07-14 mtmiller Severity3 - Normal 1 - Wish
        Item GroupMatlab Compatibility Feature Request
        StatusNone Need Info
        Release4.0.2 dev
    2016-07-14 jgillis42 Carbon-Copy- Added jgillis42

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code