Abolfazl
Abolfazl

Reputation: 453

using mkl, error while loading shared libraries: libmkl_intel_lp64.so

I'm almost new in using mkl libraries. So excuse me if it seems silly. I tried to run an example in tutorial [here] with ifort -mkl dgemm_example.f ,then run the executable file. Here is the error:

./a.out: error while loading shared libraries: libmkl_intel_lp64.so: cannot open shared object file: No such file or directory

I also searched for the similar problems but it baffled me more. do you have any idea? dgemm_example.f

Upvotes: 5

Views: 31423

Answers (5)

one
one

Reputation: 2585

In my case, I tried

pip install mkl

and export the path.

I works.

Upvotes: 0

Chemist
Chemist

Reputation: 101

I'm using CentOS and intel compiler. Type
locate compilervars.sh

Go to your '.bashrc' file and add

source /adress you got from locate command/compilervars.sh intel64

Then in terminal type
source ~/.bashrc

It will fix the error.

Upvotes: 0

user3800173
user3800173

Reputation: 11

I'm using CentOS on our workstations. Adding following lines to bashrc worked for me.

export PATH="$PATH:/opt/intel/bin"

export LD_LIBRARY_PATH="$PATH:opt/intel/mkl/lib/intel64_lin/"

Upvotes: 1

Abolfazl
Abolfazl

Reputation: 453

I copied the address of libiomp5 in /etc/ld.so.conf.d/icc.conf and used sudo ldconfig.

There is another way that every time we should use this flag: -Wl,-rpath=/opt/intel/directory/to/library/directory

and it worked.

Upvotes: 0

Figaro
Figaro

Reputation: 112

You have to set the LD_LIBRARY_PATH environment variable, otherwise the shared library will not be found at run time.

Before running your program, type export LD_LIBRARY_PATH=/path/to/your/library/directory in the (bash) shell in which you want to run your code.

If you are using Ubuntu, you can set this variable automatically by using configuration files in /etc/ld.so.conf.d/, see Ubuntu help. Similar mechanisms are available for other distributions.

Upvotes: 2

Related Questions