On Tue, 15 Jul 2008, Edwin Sarkissian wrote:
However, some of the lapack function calls never returned.
For example, the executables that are included in the package
and are used to test the lapack library never end.
I wrote the following code (test.c)
#include "f2c.h"
#include "clapack.h"
int main()
{
integer m=3, n=2, nrhs=1, lda=3, ldb=3, lwork=512, info;
double aa[]={1,1,1,2,3,4};
double bb[]={2,3,4};
double w[512];
char trans='N';
int result = dgels_( &trans, &m, &n, &nrhs, aa, &lda, bb,
&ldb, w, &lwork, &info );
return, 0;
}
I compiled and linked the code without any error message with the command
gcc test.c lapack_LINUX.a blas_LINUX.a F2CLIBS/libf2c.a -lm -IINCLUDE
but when I ran the executable a.out it never returned. However,
after I changed
the initialization value of lwork to -1 and compiled and ran the
executable, then
it returned. The argument lwork is set to -1 when we need the lapack
function to return an optimum size for work buffer only.
OK so
1- there is a problem with this code not returning without modification
2- when you perform your modification, the optimal worspace size is in
w[0], not in lwork, lwork is input only so it is left unchanged in exit as
you have observed.
I followed the same steps mentioned above exactly on a
i386 architecture / linux / 64 bit platform and all executables
ran to completion without any error or problem.
Great, great, great. I do not know what the problem 1 is ...
-julien.
|