- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I built my program with MKL statically (.a files), everything was fine. But, when I built the code with those .dylib files and ran it, I got following errors:
dyld: Symbol not found: _MKL_Detect_Cpu_Global_Lock
Referenced from: /opt/intel/compilers_and_libraries_2017.4.181/mac/mkl/lib/libmkl_intel_lp64.dylib
Expected in: flat namespace
in /opt/intel/compilers_and_libraries_2017.4.181/mac/mkl/lib/libmkl_intel_lp64.dylib
Abort trap: 6
What does this usually imply? I tried to add the directory containing .dylib files into $PATH, but it didn't help.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi xiang,
' _MKL_Detect_Cpu_Global_Lock' is bss symbol defined in libmkl_avx*.dylib, libmkl_core.dylib, libmkl_mc.dylib, libmkl_mc3.dylib, libmkl_p4m.dylib & libmkl_p4m3.dylib
If you meet linage error with missing symbol that probably because the lib path of MKL is not being linked, please use '-L${MKLROOT}/lib' for your link line. You could also check with MKL advisor to generate your link line.
Bets regards,
Fiona
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Fiona,
I'm sure I've added that path. Actually, the building process itself succeeded and the executable file was generated. These errors popped up when I ran the file.
Best,
Xiang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Xiang,
Have you run the mklvars.sh?
Generally, run one code with mkl dynamic library, please check:
add the path of lib<product>.dylib in system environment before run binary (The <product> could be "mkl" or "ipp"). There are two methods to realize the solution:
- Run shell script file to set environment variables, for example, setting MKL:
> /opt/intel/compilers_and_libraries_2017.*.***/mac/mkl/bin/mklvars.sh <ia32|intel64> - Or write command to set directly, for example, setting MKL:
> export DYLD_LIBRARY_PATH="/opt/intel/compilers_and_libraries_2017.*.***/mac/mkl/lib:$DYLD_LIBRARY_PATH
and let us know if it works.
Best Regards,
Ying
https://software.intel.com/en-us/articles/dyld-library-not-loadedlibiomp5dylib?page=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ying,
Thanks for your detailed instructions, it helped me to locate the problem. It is somehow due to my use of "find_library" command in cmake (weird). When I wrote out the full path of those libraries, the problem has gone.
Thank you again!
Best,
Xiang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No idea why this doesn't work for a simple, SIMPLE program below and I need to compile AND run with -lmkl_sequential because the library needs "_mkl_blas_caxpy". And yes I ran oneAPI setvars.sh.
`icc -L${MKLROOT}/lib -lmkl_sequential -std=c11 /Users/brian/tools/test/apbs/src/.config/float_epsilon.c -o test.o`
#include <stdio.h>
int main()
{
float floatEpsilon = 1.0;
while(1.0 + floatEpsilon / 2.0 != 1.0)
floatEpsilon /= 2.0;
printf( "%e", floatEpsilon );
return 0;
}
I get this error and it's very frustrating when it gets down to being this simple:
./test.odyld: lazy symbol binding failed: Symbol not found: _mkl_serv_core_register_cleanup
Referenced from: /opt/intel/oneapi/mkl/2022.0.0/lib/libmkl_sequential.2.dylib
Expected in: flat namespace
dyld: Symbol not found: _mkl_serv_core_register_cleanup
Referenced from: /opt/intel/oneapi/mkl/2022.0.0/lib/libmkl_sequential.2.dylib
Expected in: flat namespace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
GOT IT. Forgot about -lmkl_core form the bindings form

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page