[SciPy-user] eig() segfaults on SuSE 9.3 with ACML, Numeric's eigenvectors works

Robert Dick dickrp at wckn.com
Sun Nov 13 23:59:42 CST 2005


SuSE 9.3 comes with libblas and liblapack.  However, they don't define srotmg.  
Therefore, SciPy doesn't work with them.

AMD provides an optimized BLAS/LAPACK library called ACML.  After installing 
that and directing SciPy to it with site.cfg, SciPy builds.  Unfortunately, 
linalg.eig(), produces results that do not conform to the documentation (the 
matrix holding the eigenvectors is transposed).  I transpose this matrix in 
my own code but find that eig() also intermittantly segfaults for matrices of 
significant size.  My machine is otherwise quite stable: this is probably not 
caused by a hardware problem.

Has anybody been able to get SciPy working reliably on an Athlon SuSE 9.3 
machine?

Does the following code work without segfaulting for anybody else?  It runs 
fine as long as I use Numeric but segfaults if I use SciPy.  By the way, I'm 
linking against AMD's ACML BLAS/LAPACK library from both Numeric and SciPy.
----
import Numeric as n1
import LinearAlgebra as la1
import scipy as n2
import scipy.linalg as la2

while 1:
	mat2 = n2.stats.rand(5, 5)
	mat1 = n1.array(mat2)
	print la1.eigenvectors(mat1)
#	print la2.eig(mat2)
----

Does the following code work reliably for anybody else?

----
import scipy.linalg as la1
import scipy as n1
la1.eig(n1.array([[1.0, 1.0], [1.0, 1.0]]))
----
Should be (from Numeric's LinearAlgebra)
  (array([ 2.,  0.]), array([[ 0.70710678,  0.70710678],
         [-0.70710678,  0.70710678]]))
Unfortunately, it is transposed
  (array([ 2.+0.j,  0.+0.j]), array([[ 0.70710678, -0.70710678],
         [ 0.70710678,  0.70710678]]))

I have some PCA and non-linear multi-layer neural network backprop code I 
would be happy to give to SciPy.  However, I can't properly test this code 
with SciPy unless I have a stable eig().

Thanks for any suggestions,

-Robert Dick-



More information about the SciPy-user mailing list