I am attempting to compile the python libraries numpy and scipy using the GNU compiler and using MKL for the blas library. Explicitly linking to the appropriate fortran interface library using -lmkl_gf_lp64 -lmkl_core -lmkl_sequential -lpthread causes the failure to find mkl_avx and mkl_def bug.
Instead, the code links fine when -lmkl_rt is used, but then complex blas functions fail with segfaults.The attached fortran program illustrates this problem (exists for MKL 10.3 and 11):
$ gfortran test_cdotu.f -lmkl_gf_lp64 -lmkl_core -lmkl_sequential -lpthread
( 2.0000000 , 0.0000000 )
$ gfortran test_cdotu.f -lmkl_rt -lpthread
$ ifort test_cdotu.f -lmkl_rt -lpthread
I see segmentation fault with 11.1 version too:
[root@nntssg118-x64 u499188]# ./a.out
Intel(R) Math Kernel Library Version 11.1.1 Product Build 20131010 for Intel(R) 64 architecture applications Segmentation fault (core dumped)
the problem is escalated and we will back to you if any updates.
Hello. We confirmed the bug into MKL with gfortran. As a temporary workarond the problem you can try to add options "-ff2c -fno-second-underscore" and check if it will help. We will keep you update when the fix would be available in the product version of MKL.
The fix is available since MKL 11.1.3, and also present in MKL 11.2.x line. Please use proper environment setting:
it works on my side. here is the output I see:
gfortran test_cdotu_sdot.f -lmkl_rt -lpthread -o 2.out
2.00000000 ( 2.00000000 , 0.00000000 )