[Numpy-discussion] eigenvalues fails on cygwin

Michiel Jan Laurens de Hoon mdehoon at ims.u-tokyo.ac.jp
Mon Mar 10 18:36:08 EST 2003

Dear pythoneers,

I noticed recently that a call to eigenvalues in numpy's LinearAlgebra 
does not return with Python run from Cygwin. The eigenvalues functions 
runs fine on Linux and Windows. The problem seems to occur in the routine

int dlamc4_(integer *emin, doublereal *start, integer *base);

in Src/dlapack_lite.c. To my surprise, by adding some printf statements,
this routine can be made to work. So this seems to be related to
optimization issues. Indeed, if I compile dlapack_lite.c without
optimization, then eigenvalues works correctly without having to add any

Now in the LAPACK FAQ, I found the following statement:

 > 1.26) Problems compiling dlamch.f?
 > The routine dlamch.f (and its dependent subroutines dlamc1, dlamc2,
 > dlamc3, dlamc4, dlamc5) MUST be compiled without optimization. If
 > you downloaded the entire lapack distribution this will be taken
 > care of by the LAPACK/SRC/Makefile. However, if you downloaded a
 > specific LAPACK routine plus dependencies, you need to take care
 > that slamch.f (if you downloaded a single precision real or single
 > precision complex routine) or dlamch.f (if you downloaded a double
 > precision real or double precision complex routine) has been
 > included.

When browsing through Src/dlapack_lite.c, it seems that some tricks are 
being used (such as calling DLAMC3) to avoid optimization to take place. 
  So I can see two ways to resolve this bug:

1) Come up with more tricks to avoid optimization to take place when 
compiling dlamc4_.

2) Keep the dlamc* routines in a separate file, and let setup.py compile 
it without optimization.

Any ideas / preferences on which way to go? Unfortunately I don't know 
much about optimization issues, so all suggestions are welcome.

Michiel de Hoon
University of Tokyo, Human Genome Center.

Michiel de Hoon, Assistant Professor
University of Tokyo, Institute of Medical Science
Human Genome Center
4-6-1 Shirokane-dai, Minato-ku
Tokyo 108-8639

More information about the NumPy-Discussion mailing list