1

My numpy and scipy use OpenBLAS and this is causing multiprocessing problems with scikit-learn. The scikit-learn advanced installation instructions say that ATLAS should be used instead of OpenBLAS. I do not know how to make numpy/scipy use ATLAS instead of OpenBLAS. I tried the instructions as below, but still numpy config says its using OpenBLAS. I also tried this, but numpy, scipy still use OpenBLAS and the code freezes. The update-alternatives command clearly shows atlas selected, so I don't understand why numpy and scipy config still shows OpenBLAS being used. I am working in a Ubuntu "16.04.3 LTS (Xenial Xerus)" environment.

(.env) kai:~/work$ sudo update-alternatives --config libblas.so.3
There are 2 choices for the alternative libblas.so.3 (providing /usr/local/lib/libblas.so.3).

  Selection    Path                                    Priority   Status
------------------------------------------------------------
* 0            /usr/lib/atlas-base/atlas/libblas.so.3   100       auto mode
  1            /usr/lib/atlas-base/atlas/libblas.so.3   100       manual mode
  2            /usr/lib/libblas/libblas.so.3            10        manual mode

Press <enter> to keep the current choice[*], or type selection number: ^C
(.env) kai:~/work$ sudo update-alternatives --config libblas.so
There are 2 choices for the alternative libblas.so (providing /usr/local/lib/libblas.so).

  Selection    Path                                  Priority   Status
------------------------------------------------------------
* 0            /usr/lib/atlas-base/atlas/libblas.so   100       auto mode
  1            /usr/lib/atlas-base/atlas/libblas.so   100       manual mode
  2            /usr/lib/libblas/libblas.so            10        manual mode



>>> import numpy as np
>>> np.__config__.show()
lapack_opt_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
blas_opt_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
openblas_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
openblas_lapack_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
blas_mkl_info:
  NOT AVAILABLE

(.env) kai:~/work$ dpkg -l \*blas\* | grep ^i
ii  libblas-common 3.6.0-2ubuntu2 amd64        Dependency package for all BLAS implementations
ii  libblas-dev    3.6.0-2ubuntu2 amd64        Basic Linear Algebra Subroutines 3, static library
ii  libblas3       3.6.0-2ubuntu2 amd64        Basic Linear Algebra Reference implementations, shared library
Kai
  • 1,464
  • 4
  • 18
  • 31
  • Install `libatlas` first. Then install numpy from source and supply the `include` and `lib` directories for ATLAS in `site.config` file. This is a fairly standard procedure. If you are on linux, you can switch BLAS at run-time. See here, https://stackoverflow.com/questions/29979539/how-can-i-make-numpy-use-openblas-in-ubuntu – romeric Oct 06 '17 at 13:28
  • so I gues I have to uninstall numpy and scipy before I do that? – Kai Oct 06 '17 at 13:30
  • In a virtualenv, yes. But, you don't need to uninstall your system numpy/scipy. Or make a new environment. – romeric Oct 06 '17 at 13:33
  • updated post with output of {dpkg -l \*blas\* | grep ^i} command. I don't even see OpenBLAS, so why is it being used?! – Kai Oct 06 '17 at 13:44

0 Answers0