[Numpy-discussion] Proposed fix for MKL and dynamic loading
matthieu.brucher at gmail.com
Thu Jan 21 07:40:15 EST 2010
2010/1/21 Dag Sverre Seljebotn <dagss at student.matnat.uio.no>:
> Matthieu Brucher wrote:
>>> import sys
>>> import ctypes
>>> _old_rtld = sys.getdlopenflags()
>>> from numpy.linalg import lapack_lite
>>> del sys; del ctypes; del _old_rtld
>> This also applies to scipy code that relies on BLAS as well. Lisandra
>> Dalcin gave me a tip that is close to this one some months ago
>> The best official solution is to statically link against the MKL with
> IIUC, it should be enough to load the .so-s in GLOBAL mode once. So it
> is probably enough to ensure NumPy is patched in a way so that SciPy
> loads NumPy which loads the .so-s in GLOBAL mode, so that a seperate
> patch for SciPy is not necesarry. (Remains to be tried, I'm moving on to
> building SciPy now.)
Indeed, it should be enough.
> As for static linking, do you mean linking MKL into the Python
> interpreter itself? Or statically linking with NumPy?
statically linking with numpy. This is what was advised to me by Intel.
Information System Engineer, Ph.D.
More information about the NumPy-Discussion