I've tested with 10.1.0.018, the same issue occurs with Numpy. I have to say that it does also occur with Matlab : http://www.mathworks.com/matlabcentral/newsreader/view_thread/237079
I tried to load libmkl_def.so directly, the function is missing as well (tried libmkl_lacpack with the same result, missing __mkl_cfg_file_readed_extern function). So there is something that a lot of people are missing, and it would be great if Intel gave the answer.
This issue occured as well on some other programs. I have a shared library that uses MKL (LAPACK and FFT). If this library is linked to a program, it works. If I link it to a library that is dynamically loaded (f2py), the crash occurs.
I heard of libimalloc, but I didn't have the time to check now, but I'll try tomorrow to link against it.
libimalloc is for Windows, so no luck for me 😞
Only the FFT has an issue, I tracked down the problem to a call to DftiCommitDescriptor in my own code (don't know where it crashes exactly for Numpy or Matlab).
I tested 10.0.5 and 10.0.4 without any luck, but 10.0.011 seems OK, I didn't encounter the crash this time. I don't know what changed between 10.0.011 and 10.0.4 regarding i_free, so Intel should help us solve this issue 😉
I think the key point is here:
open("/opt/intel/mkl/10.1.0.009/lib/em64t/libmkl_mc.so", O_RDONLY) = 3
It is not appropriate way of using for MKL 10.
As workaroundyou can tryopen("/opt/intel/mkl/10.1.0.009/lib/em64t/libmkl_core.so", O_RDONLY) prior to open libmkl_[mc|def].so
"Note, we don't support the loading of processor-specific libraries and the direct usage of symbols from these libraries.
The symbols i_malloc, i_free,... are defined in libmkl_core.so. Starting with MKL 10.0 update 3, these symbols are *Undefined* in the libraries libmkl_def.so, libmkl_p4p.so and so on. We have removed some processor-independent functionality from processor-specific libraries.
More likely the reason of undefined symbol i_free is - the libmkl_def.so was "loaded on the fly"**before**libmkl_core.so has been loaded.
Just to let you know, I've upgrade my MKL to the latest version (11.3.2), and this bug in mkl_rt is still happening. Also, the LD_PRELOAD hack is still working.
I had this "Intel MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so" problem while running tests from petsc4py. Everything is standard, except numpy and PETSc are configured to use mkl (in the most standard way, through mkl_rt only).