Link ATLAS/MKL to an installed Numpy
[Reference]
http://stackoverflow.com/questions/21671040/link-atlas-mkl-to-an-installed-numpy
(1) Check the config of numpy
$ python
>>>import numpy as np
>>>np.__config__.show()
(2) Find out what BLAS library numpy is currently linked against.
$ ldd /<path_to_site-packages>/numpy/core/_dotblas.so
the default path of numpy <path_to_site-packages> is:
/usr/lib/python2.7/dist-packages/
(3) Install ATLAS/MKL/OpenBLAS if you haven't already.
$ sudo apt-get install libopenblas-dev
or
$ sudo apt-get install libopenblas-base
the default installation path is : /usr/lib/openblas-base
(4) Use update-alternatives to create a symlink to the new BLAS library of your choice. For example, if you installed libopenblas.so into /opt/OpenBLAS/lib, you would do:
$ sudo update-alternatives --install /usr/lib/libblas.so.3 \ [path]
libblas.so.3 \ [name]
/usr/lib/openblas-base/libblas.so.3 \ [new path]
50 [priority]
(5) Manually switch between multiple installed BLAS libraries.
$ sudo update-alternatives --config libblas.so.3
(6) You might still need to reinstall numpy and scipy
$ sudo apt-get remove python-numpy --purge
$ sudo apt-get remove python-scipy --purge
$ sudo apt-get install python-numpy
$ sudo apt-get install python-scipy
(6) test the np.dot() efficiency again
http://stackoverflow.com/questions/21671040/link-atlas-mkl-to-an-installed-numpy
(1) Check the config of numpy
$ python
>>>import numpy as np
>>>np.__config__.show()
(2) Find out what BLAS library numpy is currently linked against.
$ ldd /<path_to_site-packages>/numpy/core/_dotblas.so
the default path of numpy <path_to_site-packages> is:
/usr/lib/python2.7/dist-packages/
(3) Install ATLAS/MKL/OpenBLAS if you haven't already.
$ sudo apt-get install libopenblas-dev
or
$ sudo apt-get install libopenblas-base
the default installation path is : /usr/lib/openblas-base
(4) Use update-alternatives to create a symlink to the new BLAS library of your choice. For example, if you installed libopenblas.so into /opt/OpenBLAS/lib, you would do:
$ sudo update-alternatives --install /usr/lib/libblas.so.3 \ [path]
libblas.so.3 \ [name]
/usr/lib/openblas-base/libblas.so.3 \ [new path]
50 [priority]
(5) Manually switch between multiple installed BLAS libraries.
$ sudo update-alternatives --config libblas.so.3
(6) You might still need to reinstall numpy and scipy
$ sudo apt-get remove python-numpy --purge
$ sudo apt-get remove python-scipy --purge
$ sudo apt-get install python-numpy
$ sudo apt-get install python-scipy
(6) test the np.dot() efficiency again