Showing results for 
Search instead for 
Did you mean: 

dyld: Library not loaded: @rpath/libmkl_intel_lp64.dylib when running scripts

I tried to run a series of simulations using GROMACS 4.6.5 on MAC PRO in which intel composer_xe_2013 was installed. If I manually submit an individual job using commands in a terminal, I do not have any problems. However, If I want to submit a series of job using PERL scripts to run these commands, I always get the error message

dyld: Library not loaded: @rpath/libmkl_intel_lp64.dylib

The $DYLD_LIBRARY_PATH has been set and can be visited.

I do not know what is going wrong here. I read discussion at I am not very sure how to set the library link properly. Do I need to recompile GROMACS or just simply set " link with libiomp5.dylib and mkl lib path" which was stated in above link? if I run "icc -o dgemm_example dgemm_example.c -L$MKLROOT/lib -Wl,-rpath,$MKLROOT/lib -Wl,-rpath,$MKLROOT/../compiler/lib -mkl " as suggested in that discussion, how do I backup the original setting in case I failed and had a chance to recover the original setting? Any further information and help would be sincerely appreciated.


0 Kudos
1 Reply

Hi Leon,

It seems the perl shell don't recognize the  $DYLD_LIBRARY_PATH , while under the command is bash shell, which is recognize the path. 

1) how do you setting the path?  are you run

export DYLD_LIBRARY_PATH=/opt/intel/compilers_and_libraries_2018.*.***/mac/compiler/lib:/opt/intel/compilers_and_libraries_2018.*.***/mac/mkl/lib:$DYLD_LIBRARY_PATH


2) how do you write the perl script?

there are some ways as the forum topic  or
​ mainly 3 kind of type
​1. set correct environment
​2. recompile your application with -rpath , point to specific path .   or recompile with mkl static library, you don't need consider the run-time path.
​3. add the path in exe file. off-line.

​Basically, the No.1 is more easily, let's try it first. if possible, please try
> define the DYLD_LIBRARY_PATH variable in the /etc/launchd.conf file​
> , write the path in your perl script file.

​Best Regards,