Skip to content
Prev 9334 / 63424 Next

"LAPACK routine DGESDD gave error code -12" with Debian (PR#2822)

Camm Maguire <camm@enhanced.com> writes:
Right, but that's actually what we do, use the workspace query. It's
all very weird, because the -12 value indicates that the lwork
parameter is wrong, but it is computed from an exactly identical call,
except lwork=-l:

        lwork = -1;

        F77_CALL(dgesdd)(CHAR(STRING_ELT(jobu, 0)),
                         &n, &p, xvals, &n, REAL(s),
                         REAL(u), &ldu,
                         REAL(v), &ldvt,
                         &tmp, &lwork, iwork, &info);
        lwork = (int) tmp;

        work = (double *) R_alloc(lwork, sizeof(double));
        F77_CALL(dgesdd)(CHAR(STRING_ELT(jobu, 0)),
                         &n, &p, xvals, &n, REAL(s),
                         REAL(u), &ldu,
                         REAL(v), &ldvt,
                         work, &lwork, iwork, &info);


Also, this must be happening in the early parts of DGESDD which seem
to be all integer storage size calculations and so shouldn't need the
BLAS. Nevertheless people are seeing different behaviour when linking
against different BLAS libraries.
 
There are a lot of calls similar to this one, though:

      WRKBL = M + M*ILAENV( 1, 'DGELQF', ' ', M, N, -1, -1 )

so whether or not the BLAS is being used is hard to tell precisely.
--without-blas means to use generic blas routines in the R
sources?rather than any (tuned) system set.