1

I am trying to link NumPy and SciPy (under Python 3, under Fedora 20), using only RPM packages (so, no pip, manual builds, etc).

I've tried various stuff, but

import numpy as np
import scipy

scipy.__config__.show()
np.__config__.show()

always gives me the usual "I'm using ATLAS" info.

I've tried playing with alternatives, as suggested here, here, and in several other resources, but alternatives --list | grep blas is always empty. I've tried adding a libblas.so.3 alternative, linking to libopenblas.so, but the behaviour of the above test didn't change.

I've also tried to find out where and how SciPy/NumPy load these libraries, but couldn't find it.

I don't have _dotblas.so (often mentioned in various instructions related to this); however, I do have _dotblas.cpython-33m.so, cblas.cpython-33m.so, and fblas.cpython-33m.so, but none of them links to libblas.so.3 (as suggested in the previous link).

Removing ATLAS is not an option, as it drags many more packages with it (Gimp, for example).

I've also installed a fresh Fedora 20 inside a virtual machine. NumPy/SciPy from yum insisted on ATLAS. When I removed those and installed from pip, they had no problem using OpenBLAS (but then I couldn't easily switch ATLAS). I want both, with an easy switch, so I can perform various tests to compare how these two perform, and (re)installing between yum and pip is obviously not a solution.

I want to avoid rebuilding and manual installation, for easier future updates and because I need this on several somewhat different machines. It doesn't seem to me like it's a weird thing to want to do, telling these modules to load one library or another, without major reinstalls whenever I want to make the change.

Community
  • 1
  • 1
Vedran Šego
  • 3,553
  • 3
  • 27
  • 40
  • 1
    The cleanest way of doing this is the following. Don't install numpy from the repositories, but you might want to install ATLAS and openblas from the repositories. Create two virtual environments with virtualenv. Build for each environment the same version of [numpy](https://github.com/numpy/numpy/releases) with a different backend and install it in the corresponding virtual environment. Now you can easily switch your backend by activation of the virtual env. – Bort Oct 10 '14 at 12:09
  • @Bort Thank you very much. I'll give it a shot if no one offers a better solution. The `alternatives` approach seems to make the most sense to me, so I'm still hoping someone will know how to get that or a similar solution to work. – Vedran Šego Oct 10 '14 at 14:35

0 Answers0