[pymvpa] "SVD did not converge" - how can I make PyMVPA use lapack version?

Yaroslav Halchenko debian at onerussian.com
Tue Mar 6 18:49:02 UTC 2018


On Tue, 06 Mar 2018, Michael Bannert wrote:

> Dear all,

> I would like to use the lapack version of SVD since it is supposed to be
> more robust than the numpy/scipy implementations (
> http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/2014q2/002754.html
> ).

I guess you are talking about the message coming from the searchlight
hyperalignment, which has an argument for hyperalignment, which has an
argument for which transformation to use (ProcrusteanMapper by default),
and ProcrusteanMapper has a parameter 'svd' which defaults to 'numpy'
but could be set to "dgesvd" which would take that one from the
lapack... see e.g.
http://github.com/PyMVPA/PyMVPA/blob/HEAD/doc/examples/hyperalignment.py


> I have installed on my a macOS using Homebrew, which seemed to work but it
> gave me this message:

> """
> This formula is keg-only, which means it was not symlinked into /usr/local,
> because macOS already provides this software and installing another version
> in parallel can cause all kinds of trouble.

> For compilers to find this software you may need to set:
>     LDFLAGS:  -L/usr/local/opt/lapack/lib
>     CPPFLAGS: -I/usr/local/opt/lapack/include
> For pkg-config to find this software you may need to set:
>     PKG_CONFIG_PATH: /usr/local/opt/lapack/lib/pkgconfig
> """

> I defined the environment variables as suggested but PyMVPA's
> externals.exists('liblapack.so') still returns false.

> What can I do to make it work?

> Best & thanks,
> Michael

> PS: Eventually, I will need to use it on a remote Linux system where lapack
> is installed as /usr/lib64/liblapack.so.3 but PyMVPA fails to find it via
> "externals.exists('liblapack.so')" too.

note that you need to have ctypes available for that functionality

print externals.exists('ctypes')

this is what is happening underneath:

 python -c "from ctypes import cdll; print(cdll.LoadLibrary('liblapack.so'))"

so you could try smth like

LD_PRELOAD=/usr/lib64/liblapack.so.3 python -c "from ctypes import cdll; print(cdll.LoadLibrary('liblapack.so'))"

may be... and/or check if you have /usr/lib64/liblapack.so symlink to
/usr/lib64/liblapack.so.3

-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        



More information about the Pkg-ExpPsy-PyMVPA mailing list