INSTALL CLAPACK on AIX 6.1

Open discussion regarding features, bugs, issues, vendors, etc.

INSTALL CLAPACK on AIX 6.1

Postby askquestion » Tue Oct 26, 2010 3:44 pm

Hi ,

I would like to install CLAPACK on AIX 6.1 to link my C program to sgesdd(I have just C compiler - xlc and gxlc ). I did not find AIX make.inc on INSTALL directory. My BLAS library located on /usr/lib/libblas.a. My CLAPAC version is 3.2.1.

Thank you for help.

Uril.
askquestion
 
Posts: 4
Joined: Tue Oct 26, 2010 3:27 pm

Re: INSTALL CLAPACK on AIX 6.1

Postby askquestion » Wed Oct 27, 2010 12:31 pm

Hi Users,

Should I just change line from make.ini that indicate BLASLIB = ../../blas$(PLAT).a to the BLASLIB = /usr/lib/libblas.a?
Should I do any other changes?

Thanks,

Uril.
askquestion
 
Posts: 4
Joined: Tue Oct 26, 2010 3:27 pm

Re: INSTALL CLAPACK on AIX 6.1

Postby askquestion » Mon Nov 01, 2010 4:18 pm

Hi Users,

I change make.inc to:
CC = gxlc -DNO_BLAS_WRAP
BLASLIB = -lblas -lpthread
where libblas.a is located in /usr/lib.

I changed directory to SRC and typed make to create lapack_AIX.a. When I try to compile my c program(lets say myprogram.c) gxlc -o myprogram myprogram.c -L. -llapack_AIX -lblas -lf2c -lm I got next error message:
ld: 0711-317 ERROR: Undefined symbol: .snrm2_
ld: 0711-317 ERROR: Undefined symbol: .sscal_
ld: 0711-317 ERROR: Undefined symbol: .sgemv_
ld: 0711-317 ERROR: Undefined symbol: .sger_
ld: 0711-317 ERROR: Undefined symbol: .strmv_
ld: 0711-317 ERROR: Undefined symbol: .scopy_
ld: 0711-317 ERROR: Undefined symbol: .strmm_
ld: 0711-317 ERROR: Undefined symbol: .sgemm_
ld: 0711-317 ERROR: Undefined symbol: .srot_
ld: 0711-317 ERROR: Undefined symbol: .sswap_
ld: 0711-317 ERROR: Undefined symbol: .sdot_

Can you please tell me what I did wrong?

Thank you for help.

Uril.
askquestion
 
Posts: 4
Joined: Tue Oct 26, 2010 3:27 pm

Re: INSTALL CLAPACK on AIX 6.1

Postby askquestion » Tue Nov 09, 2010 3:25 pm

Hi Users,

I have successfully installed lapack on AIX 6.1, but I encountered another problem. I got Segmentation fault when I had tried to use function SGESDD. Wnen I use less dimension matrix is ended correctly.
Here is my code:

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

/* SGESDD prototype */
extern void sgesdd_( char* jobz, int* m, int* n, float* a,
int* lda, float* s, float* u, int* ldu, float* vt, int* ldvt,
float* work, int* lwork, int* iwork, int* info );
#define M 5000
#define N 1000
#define LDA M
#define LDU M
#define LDVT N

/* Main program */
int main() {
/* Locals */
int m = M, n = N, lda = LDA, ldu = LDU, ldvt = LDVT, info, lwork;
float wkopt;
float* work;
/* Local arrays */
/* iwork dimension should be at least 8*min(m,n) */
int iwork[8*N];
static float s[N], u[LDU*M], vt[LDVT*N];
static float a[LDA*N];

int i;
FILE *f;
float number;
time_t t1,t2;

/* Read numbers from matrix file into a variable */
f=fopen("matrix.txt","r");
if (!f) {
fprintf(stderr, "Unable to open input file \n");
return 1;
}

for(i=0; !feof(f); i++) {
fscanf(f,"%f\n", &number);
a[i] = number;
}

fclose(f);

(void) time(&t1);


/* Executable statements */
printf( " SGESDD Example Program Results\n" );
/* Query and allocate the optimal workspace */
lwork = -1;
sgesdd_( "Singular vectors", &m, &n, a, &lda, s, u, &ldu, vt, &ldvt, &wkopt,
&lwork, iwork, &info );
lwork = (int)wkopt;
work = (float*)malloc( lwork*sizeof(float) );
/* Compute SVD */
sgesdd_( "Singular vectors", &m, &n, a, &lda, s, u, &ldu, vt, &ldvt, work,
&lwork, iwork, &info );
/* Check for convergence */
if( info > 0 ) {
printf( "The algorithm computing SVD failed to converge.\n" );
exit( 1 );
}
(void) time(&t2);

printf("\n Time difference %d seconds \n", (int) t2-t1);
free( (void*)work );
exit( 0 );
} /* End of SGESDD Example */


When I ran the same program on linux it is ended without Segmentation fault.

Any help will be appreciated.

Thank you,

Uril.
askquestion
 
Posts: 4
Joined: Tue Oct 26, 2010 3:27 pm


Return to User Discussion

Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google [Bot] and 1 guest