Using XCode and following the MKL user s guide, I ve dynamically linked the MKL libraries to my application (called SmartOptions). When trying to debug the application, I got the following error (debug console):
Loading program into debugger... Program loaded. run
[Switching to process 21256]
dyld: Library not loaded: libmkl_intel_ilp64.dylibReferenced from: /Users/aludin/Documents/SmartOptions/build/Debug/SmartOptions.app/Contents/MacOS/SmartOptionsReason: image not found
By setting theDYLD_LIBRARY_PATH environment variable (Group & Files-> Executables->SmartOptions->dbl click->arguments Tab) to/opt/intel/Compiler/11.1/080/Frameworks/mkl/lib/em64t, then the application launches correctly.
yes, before running any application you have to setting up all environment variables which are related MKL. the easiest way to do that - to launch mklvarsem64t.sh scripts from
It is rightwhen use dynamic linkinglibrary, please make sure the DYLD_LIBRARY_PATH is defined so that exactly the dynamic librariesare found and used at run time.
We mentioned that inuserguide or KB in sporadic places.
I will ask our doc team to hightligh it inKB or user guide.
Thank you a lotfor the sharing.
It is correct that you should set DYLD_LIBRARY_PATH environment variable to full path to directory that contains dynamic libraries.
Could you please specify your question more precisely? It is unclear from description above.
Pleased forgive me for the delayed response. Actually I was nt asking a question, just noticed the behavior as described in my previous post. In the meantime I checked a few things and here s my comments:
1) You can t simply call the script for setting the environment variables:
First I tried something like opening a Terminal window and then calling the script:
However the environment variables would still be undefined (echo $MKLROOT or echo $DYLD_LIBRARY_PATH would yield to empty strings). Then I realized that you actually have to source the script using something like:
This time the environment variables would be correctly set.
2) In order to avoid the source command each time I opened a terminal window, I created a .bash_profile in my home directory and added the source command in the file:
Tested it and works fine.
3) However, even if I source the script before launching XCode, the debugger will still complain with an "image not found" message. You really have to set DYLD_LIBRARY_PATH inside XCode as mentioned in my previous post in order for gdb to find the libraries.
Iagree completelywith your previous post and would like to add some small comment.
In case of multithreaded version of MKL you should also add path to the compiler 'lib' directory in DYLD_LIBRARY_PATH like this:
It is needed because 'lib' directory of the compiler contains libiomp5.dylib library.
The notes should be added in user guide of the latest MKL release, MKL 10.2.6 or corresponding compiler version: