5

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

Abolfazl
  • 453
  • 4
  • 8
  • 19

5 Answers5

2

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.

Figaro
  • 112
  • 5
1

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/"
francescalus
  • 30,576
  • 16
  • 61
  • 96
0

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.

Abolfazl
  • 453
  • 4
  • 8
  • 19
0

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.

Chemist
  • 101
  • And if there's no `locate` installed, or more than one `compilervars.sh` is available, or the user isn't in a bash shell? – francescalus Jan 25 '18 at 08:11
  • You can install `locate` from repository I guess. I don't know how to deal with multiple `compilervars.sh` problem. Maybe he/she can try using all the addresses available or choose intuitively. I am new to all these stuff, but I am trying to suggest what I did to fix this error. Hope it helps. – Chemist Mar 06 '18 at 05:07
  • How do you go to your .bashrc file? where is it? – June Wang Aug 28 '20 at 05:34
0

In my case, I tried

pip install mkl

and export the path.

I works.

one
  • 2,205
  • 1
  • 15
  • 37