tags:

views:

40

answers:

1

Trying to import numpy in Python 2.6 I run into:

from numpy.linalg import lapack_lite

ImportError: libmkl_lapack.so: cannot open shared object file: No such file or directory

There are multiple instances of Intel's Math Kernel Library on the machine providing libmkl_lapack.so and I'm pointing at them with every relevant or semi-relevant environmental variable I can think of (most notably, I guess, $LD_LIBRARY_PATH and $PYTHONPATH). I don't have permission to run ldconfig.

This is on a well-used machine and there are multiple Python and NumPy installs. Python2.6 is in my /home/me/usr/ but there is an older installation of Python2.4 in /usr/ which will import lapack_lite without issue. So I'm not sure where to go from here.

Thanks for anything!

A: 

you can try

strace python your_script.py

to see what it is trying.

That will trace all syscalls, therefore showing you the underlying open made by python.

Scharron
All right thanks. According to strace python's looking in "/opt/gridengine/lib/lx26-amd64/" and the four directories specified by "/etc/ld.so.cache". I cannot create links from any of these directories to the known locations of libmkl_lapack.so (and I still can't update /etc/ld.so.cache). Will keep trying...
Bryan
What about LD_PRELOAD 'ing the library ?LD_PRELOAD=/path/to/libmkl_lapack.so python your_script.pyI don't think it'll work, but you can give it a try.
Scharron
I get"ERROR: ld.so: object '.../libmkl_lapack.so' from LD_PRELOAD cannot be preloaded: ignored."Before the script even begins to run (and, of course, the same "No such file" error when it does).
Bryan
Are you sure your libmkl_lapack.so exists. I mean, are you sure it's not a broken symlink ? (ls -l /path/to/libmkl_lapack.so should help).If it exists, can't it be a 64bits VS 32bits problem ?Try readelf -h /path/to/libmkl_lapack.so(You should have Class: ELF32 / ELF64)And uname -a(You should have i586 / i686 / x86_64).
Scharron
The two available instances of mkl (which both exist) offer separate 32 and 64 bit libraries. I'm employing the 64 bit (for x86_64). Like I said in the OP, I can actually import lapack_lite without issue in Python2.4, so I don't think the file itself is an issue...
Bryan