Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7074 Discussions

Numpy and Scipy with MKL: installation troubles

Garnier__Maxime
Beginner
1,851 Views

Hi,

I am currently trying to build Numpy and Scipy with MKL on Ubuntu 18.04 following your tutorial (but not using the Intel compilers). It seems that everything works for Numpy. Here is the 

np.__config__.show()

 

blas_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/include']
blas_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/include']
lapack_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/include']
lapack_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/compilers_and_libraries_2018/linux/mkl/include']

 

but when trying to build SciPy, it happens that my system cannot find mutiarray which seems to be due to the fact that it cannot find 

libmkl_rt.so

I don't know how to work around that. I have tried following this tutorial too https://www.elliottforney.com/blog/npspmkl/

 

Any hints would be appreciated!

 

Thanks in advance

0 Kudos
2 Replies
Ying_H_Intel
Employee
1,851 Views

YHi Maxime,

what is the exact message you are seeing at which exact step? do you mean

When run

$python setup.py build 2>&1 | less
 
# for python3
#python3 setup.py build 2>&1 | less

Note: If you re-build for any reason (including for python3) you will need to clean up with python setup.py clean –all In the output that is piped to less, you can't  see something like this telling you that MKL was found ? :

Or let's check the environment

1. You may check if you set the environment for MKL before build the scipy ,  run  

$ source /opt/intel/compilers_and_libraries_2018/linux/mkl/bin/mklvars.sh intel64?

2. what is the output
$export
​or
3. ldd ~/.local/lib/python2.7/site-packages/numpy/core/_dotblas.so
 

We’ll also need to set our LD_LIBRARY_PATH so that the MKL libraries can be found at run time. This should be added to your .bashrc (or whichever bash init scripts you use).

Best Regards,
​Ying

0 Kudos
Garnier__Maxime
Beginner
1,851 Views

 

Dear Ying,

Sorry for the very late reply but I managed to solve my problems thanks to your post.

Thanks again,

Best regards,

 

0 Kudos
Reply