将MKL链接到Anaconda中已安装的Numpy吗? [英] Link MKL to an installed Numpy in Anaconda?

查看:362
本文介绍了将MKL链接到Anaconda中已安装的Numpy吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

>>> numpy.__config__.show()
atlas_threads_info:
  NOT AVAILABLE
blas_opt_info:
    libraries = ['f77blas', 'cblas', 'atlas']
    library_dirs = ['/home/admin/anaconda/lib']
    define_macros = [('ATLAS_INFO', '"\\"3.8.4\\""')]
    language = c
atlas_blas_threads_info:
  NOT AVAILABLE
openblas_info:
  NOT AVAILABLE
lapack_opt_info:
    libraries = ['lapack', 'f77blas', 'cblas', 'atlas']
    library_dirs = ['/home/admin/anaconda/lib']
    define_macros = [('ATLAS_INFO', '"\\"3.8.4\\""')]
    language = f77
openblas_lapack_info:
  NOT AVAILABLE
atlas_info:
    libraries = ['lapack', 'f77blas', 'cblas', 'atlas']
    library_dirs = ['/home/admin/anaconda/lib']
    define_macros = [('ATLAS_INFO', '"\\"3.8.4\\""')]
    language = f77
lapack_mkl_info:
  NOT AVAILABLE
blas_mkl_info:
  NOT AVAILABLE
atlas_blas_info:
    libraries = ['f77blas', 'cblas', 'atlas']
    library_dirs = ['/home/admin/anaconda/lib']
    define_macros = [('ATLAS_INFO', '"\\"3.8.4\\""')]
    language = c
mkl_info:
  NOT AVAILABLE

这是numpy.配置 .show()

This is numpy.config.show()

这个数字是基于Anaconda的.

And this numpy is based on Anaconda.

同时,我已经在/opt/intel/mkl中安装了MKL.

And meanwhile, I have installed MKL in /opt/intel/mkl.

而且,当我将Theano与这个Anaconda和这个numpy一起使用时,我似乎可以使用MKL.

谢谢〜

推荐答案

为此,您必须获取 Numpy源代码,并在主文件夹中创建一个site.cfg文件,该文件告诉Numpy在哪里查找MKL库.使用site.cfg.example文件作为指南; MKL上有一个部分可以告诉您所需的确切行.

To do this, you'll have to get the Numpy source code and create a site.cfg file in the main folder that tells Numpy where to look for the MKL libraries. Use the site.cfg.example file as a guide; there's a section in there on MKL that should tell you the exact lines you need.

一旦有了site.cfg文件,请运行python setup.py config.这将吐出配置信息(看起来像numpy.config.show()的输出).您应该在那里看到MKL库的路径(如果没有,则必须使用site.cfg文件,直到这样做为止).

Once you have a site.cfg file, run python setup.py config. This will spit out the configuration info (it looks like the output of numpy.config.show()). You should see the paths to your MKL libraries in there (if not, you'll have to play around with the site.cfg file until you do).

然后,您可以使用python setup.py buildpython setup.py install进行构建和安装.您可能要先卸载旧的Numpy.

Then, you can build and install with python setup.py build and python setup.py install. You may want to uninstall your old Numpy first.

我在通过OpenBLAS安装Numpy上有一篇博客文章.尽管您的情况有所不同,但我认为很多步骤都相似.

I have a blog post on installing Numpy with OpenBLAS. While your situation is a little different, a lot of steps are similar I think.

这篇关于将MKL链接到Anaconda中已安装的Numpy吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆