I'm trying to generate dot product of two matrices using the below compiling command in Linux-GCC:
gcc -L/usr/lib64/atlas -lblas code.c
and here is the code which seems to have compiled without an error:
#include < stdio.h>
int main()
{
int n,incx,incy;
int x[] = {1,2,3};
int y[] = {2,3,4};
int z;
incx =1;
incy =1;
n = 3;
z = sdot_(&n, x, &incx, y, &incy);
printf("%d", z);
printf("\n");
return 0;
}
So I expect to see 1*2 + 2*3 + 3*4 = 20, however when I run the binary the result "3" is printed.
Any ideas?