Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
599 Views

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

Jump to solution

I am on High Sierra (OS X 10.13), and this is my first time I am using the Intel MKL. I want to compile the example shown here

https://software.intel.com/en-us/mkl-tutorial-c-multiplying-matrices-using-dgemm

using MKL 2018. As suggested by the example, I create a file with the name: dgemm_example.c, and then I compile it using

icc -mkl dgemm_example.c -o dgemm_example

When running it:

./dgemm_example

I get the following message:

dyld: Library not loaded: @rpath/libmkl_intel_lp64.dylib
  Referenced from: /Users/hesquivel/Desktop/./dgemm_example
  Reason: image not found
Abort trap: 6

I was wondering how to make this library be loaded and avoid the error.

Thank you,

Hugo

PS: I am using a MacBookPro14,3 (Intel Core i7, 3.1 GHz, Mid 2017).

0 Kudos

Accepted Solutions
Highlighted
Employee
599 Views

Hi Hugo,

"-mkl" is threaded dynamic linking with MKL, you have to set environmental variable. Please Run shell script file to set environment variables, for example, setting lib path for compilers and libraries:

$source /opt/intel/compilers_and_libraries_2018.*.***/mac/bin/compilervars.sh <ia32|intel64>

or you could export $DYLD_LIBRARY_PATH by yourself.

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

Please follow these articles to view detail info:

Compiling and linking MKL with Xcode*
Intel® Math Kernel Library for Mac OS* X User's Guide

View solution in original post

0 Kudos
4 Replies
Highlighted
Employee
599 Views

Hi,

1. Please check with DYLD_LIBRARY_PATH, if lib path of MKL and compiler are set correctly.
2. Please try to link with 
libiomp5.dylib and mkl lib path, 
icc -o dgemm_example dgemm_example.c -L$MKLROOT/lib -Wl,-rpath,$MKLROOT/lib -Wl,-rpath,$MKLROOT/../compiler/lib -mkl 

Best regards,
Fiona

0 Kudos
Highlighted
Beginner
599 Views

Hi Fiona,

By executing:

echo $DYLD_LIBRARY_PATH

I get nothing.

Compiling dgemm_example.c with your command line makes the executable run as expected.

icc -o dgemm_example dgemm_example.c -L/opt/intel/mkl/lib -Wl,-rpath,/opt/intel/mkl/lib -Wl,-rpath,/opt/intel/mkl/../compiler/lib -mkl

I was wondering how I should define DYLD_LIBRARY_PATH to make the missing library be added automatically.

Thanks!

Hugo

0 Kudos
Highlighted
Employee
600 Views

Hi Hugo,

"-mkl" is threaded dynamic linking with MKL, you have to set environmental variable. Please Run shell script file to set environment variables, for example, setting lib path for compilers and libraries:

$source /opt/intel/compilers_and_libraries_2018.*.***/mac/bin/compilervars.sh <ia32|intel64>

or you could export $DYLD_LIBRARY_PATH by yourself.

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

Please follow these articles to view detail info:

Compiling and linking MKL with Xcode*
Intel® Math Kernel Library for Mac OS* X User's Guide

View solution in original post

0 Kudos
Highlighted
Beginner
599 Views

Hi Fiona,

Thanks a lot for the details and support. I think I am ready to begin using MKL on High Sierra.

Best,

Hugo

0 Kudos