There are discrepancies between the required minimum value of the argument lwork (i) as stated in the documentation, (ii) as returned by a workspace query with lwork=-1 and (iii) the value required to pass the input argument check in routine DGESVD, for the case JOBU='N', JOBVT='N' -- the case where only the singular values are desired. Here is a reproducer, based on the details provided in another thread ("bug in MKL 11.0update5 DGESVG", http://software.intel.com/en-us/forums/topic/402436). The outputs were obtained using IFort 13.1.3.198/32-bit on Win-8-Pro-64.
program dgesvdx
c Program to demonstrate incorrect estimate of lwork in call to ?gesvd
c in MKL 11.0.5
c
c use mkl_lapack
implicit none
character*1 :: jobu, jobvt
integer :: m,n,lda,ldu,ldvt,lwork,info
double precision :: A(1,10)
double precision :: work(13),S(1),U(1),VT(1)
character*200 buf
data A/2d0, 7d0, 5d0, 9d0, 3d0, 6d0, 2d0, 5d0, 4d0, 8d0/
c
call mkl_get_version_string( buf )
write(*,'(A)')buf
m=1
n=10
jobu='N'
jobvt='N'
lda=1
ldu=1
ldvt=1
c
c First call to find lwork needed
c
lwork=-1
call dgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt,
+ work, lwork, info)
write(*,*)'info = ',info,' lwork asked for by MKL =',work(1)
lwork=nint(work(1))
c
c starting with size returned, try increasing values until DGESVD
c accepts the value as sufficient
c
info=-1
do while(info .lt. 0)
call dgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt,
+ work, lwork, info)
write(*,*)'lwork = ',lwork,' info = ',info
lwork=lwork+1
end do
write(*,*)'s = ',s(1)
end program dgesvdx
Output with version 11.0.1 of MKL
Intel(R) Math Kernel Library Version 11.0.1 Product Build 20121016 for 32-bit applications
info = 0 lwork asked for by MKL = 5.00000000000000
lwork = 5 info = 0
s = 17.6918060129541
Output with version 11.0.5 of MKL
Intel(R) Math Kernel Library Version 11.0.5 Product Build 20130612 for 32-bit applications
info = 0 lwork asked for by MKL = 5.00000000000000
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 5 info = -13
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 6 info = -13
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 7 info = -13
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 8 info = -13
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 9 info = -13
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 10 info = -13
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 11 info = -13
MKL ERROR: Parameter 13 was incorrect on entry to DGESVD.
lwork = 12 info = -13
lwork = 13 info = 0
s = 17.6918060129541