Donnerstag, 19. Februar 2009

Installing scipy 0.7.0 on openSUSE

I had to rebuild parts of my toolchain because I messed up my OS and needed to reinstall. In the process of searching for nice numpy and scipy packages for openSuSE (which failed), I discovered that now its actually possible to do
easy_install numpy
easy_install scipy

(provided that you have the python-distutils package installed). That's great. But... it doesn't work! At least not on openSUSE. I could convince numpy to install somehow. I don't remember exactly, I think I at least needed to install gfortran, maybe also blas and lapack from the scientificlinux-repository in the build service.

For scipy then it was a little bit more work. It kept complaining that it did not find BLAS and LAPACK, even though I edited numpy's site.cfg file so that it should be aware of the location of the shared libs.

It turned out that to install scipy I had to:

  1. Download BLAS sources and unpack them, e.g. to $HOME/Apps/BLAS
  2. edit in that directory, changing the FORTRAN line to
    FORTRAN  = gfortran

  3. build BLAS by calling make in the BLAS dir
  4. DL and unpack LAPACK to $HOME/Apps/lapack-3.2
  5. edit in that dir, changing the BLASLIB line to
    BLASLIB = $(HOME)/Apps/BLAS/blas$(PLAT).a
    and saving that file as
  6. build LAPACK by typing make in the lapack dir.
  7. Download scipy, unpack it and start the build process:
    python install

That takes quite a while. It seems it builds LAPACK and BLAS again, so maybe you don't have to build it first, but I guess you need at least to make the appropriate modifications to the respective files. Comments on that are welcome.

But most important: it finally worked :)

Update: At least I thought it worked. It didn't :D Problem was that import scipy produced a symbol not found error. Maybe adjusting ldconfig's path could fix this, but I don't have time to look into this. Installed numpy & scipy from the scientificLinux repo (link see above).


Beta hat gesagt…

I want to installing scipe on my OpenSUSE, thanks already to guide how to install.

mschmuker hat gesagt…

Hi Beta,

note that in the meantime scipy is available from the distribution repositories. I use scipy from the "education" repo. is always helpful.