[Numpy-discussion] ANN: NumPy 1.8.1 release

Matthew Brett matthew.brett at gmail.com
Mon Mar 31 15:05:40 EDT 2014


Hi,

On Mon, Mar 31, 2014 at 11:55 AM, Chris Barker <chris.barker at noaa.gov> wrote:
> On Mon, Mar 31, 2014 at 10:18 AM, Matthew Brett <matthew.brett at gmail.com>
> wrote:
>>
>> > Bonus question: do you think a similar solution could work for windows
>> > and / or linux?
>>
>> For linux - yes - I think that should be easy with a combination of
>> ``ldd`` to find the dependencies and ``patchelf`` to set the rpath to
>> point to the copied library.
>
>
> that part, yes, but isn't Linux too much of a varying target for there to be
> any point anyway?

You mean, the /usr/lib stuff varies too much, so that any copied
dynamic libraries would have little chance of binary compatibility
with the system libs?

>> For Windows - I believe that it is not possible to set relative paths
>> for windows DLLs, but I'd be very happy to be corrected.  There is a
>> function SetDllDirectory [1], but this would need some extra extension
>> code in the package.  Windows experts - is that an option?
>
>
> The "usual" way is to put the dll next to where it is needed. I _think_ a
> when a one dll (the pyton extension) is linked to another one, the first
> place windows looks is right next to the one loading it -- same as for dlls
> linked to main executables.

I had assumed from [1] is that it's the path of the executable not the
loading DLL that is on the DLL search path, but I might well be wrong

I guess, if it was the path of the loading DLL, you'd run into trouble
because you'd likely have python extensions in several directories,
and then you'd need to copy the dependencies into all of them.

> Unfortunately, anywehre else and all bets are off -- I was fighting with
> this a while back and found what I think is the source of "DLL Hell" -- it's
> the combination of these two:
>
> 1) Windows looks next to the executable for dll.
> 2) The search  PATH for executables and dlls is the same.
>
> So some folks put dlls next to the executable
> And other folks get bit because the search PATH finds dlls next to unrelated
> executables.
>
> The python.org python install has a DLLs directory:
>
> C:\Python27\DLLs
>
> Maybe putting them there with nice long, non-standard names would work.

Sounds reasonable to me.

> Has anyone looked at how Anaconda does it?

Not me - would be interested to know.

Cheers,

Matthew

[1] http://msdn.microsoft.com/en-us/library/ms682586(v=vs.85).aspx#standard_search_order_for_desktop_applications



More information about the NumPy-Discussion mailing list