[Numpy-discussion] Proposed fix for MKL and dynamic loading

Matthieu Brucher matthieu.brucher@gmail....
Thu Jan 21 06:17:58 CST 2010


> try:
>    import sys
>    import ctypes
>    _old_rtld = sys.getdlopenflags()
>    sys.setdlopenflags(_old_rtld|ctypes.RTLD_GLOBAL)
>    from numpy.linalg import lapack_lite
> finally:
>    sys.setdlopenflags(_old_rtld)
>    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
(http://matt.eifelle.com/2008/11/03/i-used-the-latest-mkl-with-numpy-and.../).
The best official solution is to statically link against the MKL with
Python.

Matthieu
-- 
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher


More information about the NumPy-Discussion mailing list