The issue occurred with Lapack+BLAS libraries shipped by Debian (libatlas3gf-base 3.6.0-22 + liblapack3gf 3.1.1-1), and also on those by Ubuntu (libblas3gf 1.2-2build1 + 3.2.1-2). Both are gfortran-built.
I also downloaded LAPACK 3.2.1 (
http://netlib.org/lapack/lapack.tgz) and BLAS (
http://netlib.org/blas/blas.tgz) built it using the default make.inc's as-is (except changing BLAS's to use gfortran). This means "-g" for LAPACK and "-O3" for BLAS.
On the Ubuntu machine (32-bit linux intel atom), I have
- Code: Select all
$ gfortran --version
GNU Fortran (Ubuntu 4.4.3-4ubuntu5) 4.4.3
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a lapack-3.2.1/blas_LINUX.a
$ ./test < L.txt
orth error ( 2 eigs): 0.98018274937637251 HUGE ERROR
orth error ( 3 eigs): 0.98018274937637251 HUGE ERROR
orth error ( 4 eigs): 0.98018274937637251 HUGE ERROR
orth error ( 5 eigs): 1.25314924656247904E-016
orth error ( 6 eigs): 2.17735748322348682E-016
The same also with BLAS compiled with "-g" instead of "-O3". Moreover, the same occurs also with everything built with
- Code: Select all
$ gfortran-4.3 --version
GNU Fortran (Ubuntu 4.3.4-10ubuntu1) 4.3.4
On the Debian machine (64-bit intel xeon), I get from the same procedure
- Code: Select all
$ gfortran --version
GNU Fortran (Debian 4.3.2-1.1) 4.3.2
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a lapack-3.2.1/blas_LINUX.a
$ ./test < L.txt
orth error ( 2 eigs): -2.67037960893108216E-032
orth error ( 3 eigs): 4.46452343408814271E-033
orth error ( 4 eigs): -2.67037960893108216E-032
orth error ( 5 eigs): 2.73435787900844218E-016
orth error ( 6 eigs): 1.45283091113057594E-017
orth error ( 7 eigs): -7.06450011644714449E-033
So no error there, and adding "-O2" or "-O3" to LAPACK compilation doesn't seem to break anything.
Moreover,
- Code: Select all
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a -lblas-3
22:59 pauli@phys:~/tmp$ ./test < L.txt
orth error ( 2 eigs): -1.80363506134932581E-032
orth error ( 3 eigs): 0.99999999999998068 HUGE ERROR
orth error ( 4 eigs): 0.99999999999998068 HUGE ERROR
orth error ( 5 eigs): 0.0000000000000000
orth error ( 6 eigs): 0.0000000000000000
orth error ( 7 eigs): 0.0000000000000000
orth error ( 8 eigs): -3.13768108717304983E-016
orth error ( 9 eigs): -4.51028103753969845E-017
orth error ( 10 eigs): 1.40946282423115576E-016
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a BLAS/blas_LINUX.a
$ ./test < L.txt
orth error ( 2 eigs): -2.67037960893108216E-032
orth error ( 3 eigs): 4.46452343408814271E-033
orth error ( 4 eigs): -2.67037960893108216E-032
orth error ( 5 eigs): 2.73435787900844218E-016
$ gfortran -o test test.f90 -llapack-3 BLAS/blas_LINUX.a
$ ./test < L.txt
orth error ( 2 eigs): 9.82816896344506035E-019
orth error ( 3 eigs): 9.82816896344506035E-019
orth error ( 4 eigs): 9.82816896344506035E-019
orth error ( 5 eigs): 1.24132789084528224E-017
So it seems like the Debian-supplied BLAS is somehow faulty, at least in this case.
A third machine (Debian Lenny, Athlon 64-bit), shows similar behavior as the above 64-bit machine.
So, there seem to be problems with 32-bit self-compiled and all distributor-supplied packages. So it looks very much like a compiler-related problem, unless there's some bitness issues...