How to use numpy with OpenBLAS instead of Atlas in Ubuntu?

后端 未结 3 1305
孤城傲影
孤城傲影 2020-12-14 03:22

I have looked for an easy way to install/compile Numpy with OpenBLAS but didn\'t find an easy answer. All the documentation I have seen takes too much knowledge as granted f

3条回答
  •  猫巷女王i
    2020-12-14 03:59

    To add to the accepted answer (of using update-alternatives), the reason for this is because OpenBlas is not compatible with the Atlas version of Lapack. For each of the Blas and Lapack versions:

    1. Default Blas + Default Lapack => OK
    2. OpenBlas + Default Lapack => OK
    3. Atlas-Blas + Default Lapack => OK
    4. Atlas-Blas + Atlas-Lapack => OK
    5. OpenBlas + Atlas-Lapack => ERROR! (The following case here.)

    This is from both personal experience (with the exact same issue) and realizing why such a combination wasn't mentioned in this comparison blog.

    By the way, you can just find the necessary files in /etc/alternatives/, usually with a filename starting with lib*. For each one do sudo update-alternatives --config . For example, do to following:

    • sudo update-alternatives --config libblas.so
    • sudo update-alternatives --config libblas.so.3

    to change the Blas version.

提交回复
热议问题