[SciPy-user] matrix inversion time (Python vs MATLAB)

David Cournapeau cournape at gmail.com
Sun Jan 11 02:57:04 EST 2009


On Sun, Jan 11, 2009 at 8:42 AM,  <josef.pktd at gmail.com> wrote:
> On Sat, Jan 10, 2009 at 6:08 PM, Matthieu Brucher
> <matthieu.brucher at gmail.com> wrote:
>>> So I think that, if you want to link against mkl, then the best would
>>> be to make a local copy of the dlls. This seems to be the common
>>> policy,  for example, I have more than 10 programs (mostly open
>>> source, including numpy/scipy) that all have their own lapack in the
>>> local directories.
>>
>> Contrary to usual programs, Python is scattered in several folders,
>> and in the absolute, the dll should be put in the main Python folder
>> to be seen by Python at runtime. But then what would you do if other
>> modules provide their own MKL dlls?
>
> Currently scipy has duplicates of lapack, blas in different folders,

Not really: we have copy of blas/lapack in scipy/lib, but that has
nothing to do with build issues: the code itself is duplicated.

> so having several copies
> of another set of dlls wouldn't make much difference.

Sure, but then you have to wonder: what's the point of dynamic linking
:) Statically linking everything is more or less the same as copying
the dll everywhere, with the benefit it is more reliable. The drawback
is memory waste (since the code cannot be shared), but well, it is not
like a few MB will make a difference on windows.

> If they are put
> in the main python folder, they could be renamed (if that is possible,
> since it would be a "private" copy) to lapack_scipy.dll.

I don't think we should install anything in the main python folder. I
personally would be pissed if other softwares did that.

> I think numpy/scipy should have
> its own copies of the dlls and not rely on a system wide install.

Yes, it would be good if it that was possible. But as you see, it is
difficult. It is difficult on any platform, but windows makes it
particularly difficult. It is so difficult that almost noone does it:
either they put all their dll in one directory (as matlab, as you
pointed out), but we can't do that, or they install globally, or in
the SxS. Manifest could in theory solve this (they are a MS mechanism
to refer to dll inside other dll) - but the system was obviously not
designed to be used by other tools, it can be safely considered as an
implementation scheme specific to MS compilers. As almost anything MS
related, you have to use MS tools only if you want to use this feature
at this point.

David



More information about the SciPy-User mailing list