- Code: Select all
`[ntcgrid] lapack-3.3.1> make -j2 lapack_testing`

...

make[1]: *** [stest.out] Error 2

make[1]: *** Waiting for unfinished jobs....

make[1]: Leaving directory `/scratch/lisaev/lapack-3.3.1/TESTING'

make: *** [lapack_testing] Error 2

[ntcgrid] lapack-3.3.1>

[ntcgrid] lapack-3.3.1> cat ./TESTING/stest.out

At line 57 of file ilaslr.f

Fortran runtime error: Index '0' of dimension 1 of array 'a' below lower bound of 1

Tests of the REAL LAPACK routines

LAPACK VERSION 3.3.1

...

The make.inc is:

- Code: Select all
`[ntcgrid] lapack-3.3.1> cat make.inc | grep -v -e ^$ -e ^#`

SHELL = /bin/bash

PLAT = _test

FORTRAN = gfortran -fimplicit-none

OPTS = -O3 -march=native -fimplicit-none -fcheck=all

DRVOPTS = $(OPTS)

NOOPT = -O0

LOADER = gfortran

LOADOPTS =

TIMER = INT_CPU_TIME

ARCH = ar

ARCHFLAGS= cr

RANLIB = ranlib

BLASLIB = ../../blas$(PLAT).a

XBLASLIB =

LAPACKLIB = lapack$(PLAT).a

TMGLIB = tmglib$(PLAT).a

EIGSRCLIB = eigsrc$(PLAT).a

LINSRCLIB = linsrc$(PLAT).a

The system is linux x86_64 and I am using a custom-built gfortran 4.5.3.

The problem happens because of this piece of code:

- Code: Select all
`[ntcgrid] lapack-3.3.1> sed -n '48,62p' ./SRC/ilaslr.f`

IF( M.EQ.0 ) THEN

ILASLR = M

ELSEIF( A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN

ILASLR = M

ELSE

* Scan up each column tracking the last zero row seen.

ILASLR = 0

DO J = 1, N

I=M

DO WHILE ((A(I,J).NE.ZERO).AND.(I.GE.1))

I=I-1

ENDDO

ILASLR = MAX( ILASLR, I )

END DO

END IF

If the matrix has no non-zero rows and is defined as

- Code: Select all
`real::a(d,d)`

then the element a(0,j) is references, which is out-of-bounds and triggers a runtime error.

I don't quite understand, what this [ilaslr.f] subroutine is supposed to do, because if I disable runtime checks and apply is to the matrix (real::a(1:3,1:3))

- Code: Select all
`1.0 1.0 1.0`

1.0 1.0 1.0

0.0 0.0 0.0

It returns 3, while the correct answer is 2, no? I would say the 'fix' is the following loop:

- Code: Select all
`do j=1,n`

do i=m,1,-1

if (a(i,j)/=zero) exit

end do

ilaslr=max(iladlr,i)

end do

Thank you.