octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcc 3.4 and Octave/lapack problems


From: Dmitri A. Sergatskov
Subject: gcc 3.4 and Octave/lapack problems
Date: Thu, 11 Nov 2004 00:37:39 -0700
User-agent: Mozilla Thunderbird 0.8 (X11/20041020)

I was playing with freshly released Fedora Core 3 and noticed that
the Octave (2.1.57) included with this distribution has a problem with
some lapack functions. In particular:

octave:1> a=rand(100);
octave:2> tic; eig(a); toc
error: dgeev failed to converge
octave:2>

It is quite reproducible, except sometimes it hangs for few minutes and I kill
it (Ctrl-C) before the error show up.
The Octave in FC3 is compiled against reference lapack-3.

I removed octave,lapack and blas and compiled my own version of octave
(both 2.157 and 2.1.61 versions) against ATLAS (which I compile myself as well).
I used "-O2 -march=athlon-xp" flags.
The result was the same.

Finally, the solution was to use FFLAGS="-O2 -ffloat-store -march-athlon-xp".
There were multiple discussions that -ffloat-store slows things down,
but so far I have not noticed any. In fact some procedures run almost
20% faster (schur()) -- I assume it is iterative and now converges faster.

I filed this problem to redhat as a bug against gcc
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=138683
and Jakub Jelinek responded that:

<<<<
        For code that relies on computation not being done with extra
        precision -ffloat-store is a must and lapack clearly relies on it.
        Why things worked in this particular case with < GCC 3.4 and don't work 
anymore
        is most probably because GCC is now better at optimizing and likely 
will have
        less spills to memory (and only spills to memory on the mis-designed 
i387 FPU
        round to the declared precision instead of using full long double 
precision).
>>>>

He also promised to look at the code (dgeev.f and perhaps other?) which causes 
the
problem, but it is hard for me to figure out all parameters it is called with, 
so
perhaps somebody can help me with it.

Also, if -ffloat-store indeed the must for lapack/octave, should we make it a 
default?

Any help and insightful thoughts would be greatly appreciated.

Sincerely,

Dmitri.
--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]