How to run dgemms subroutine on mac computer

AI Thread Summary
The discussion revolves around the user's attempt to run the 'dgemul' subroutine for matrix multiplication on a Mac using the Accelerate framework. The user is confused because the function 'dgemul' is not recognized, and they reference a source that appears to describe ESSL rather than LAPACK. Participants clarify that LAPACK does not include a 'dgemul' subroutine and suggest checking LAPACK documentation for the correct matrix multiplication routine. The conversation highlights the importance of using the appropriate library for matrix operations on macOS. Understanding the distinction between ESSL and LAPACK is crucial for resolving the issue.
missfangula
Messages
32
Reaction score
0

Homework Statement



I wrote a program to run the dgemul subroutine on my mac to find the matrix product for matrix a and matrix b, outputted as matrix c, just like the reference manual told me to. Being a mac user, I added the accelerate framework to the file which contain all the lapack stuff, but it does not recognize 'dgemul' as a function. Can someone please enlighten me as to what I am doing wrong? Below is the completed program.

Homework Equations


The Attempt at a Solution



#import <Foundation/Foundation.h>
#include <Accelerate/Accelerate.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

int main ()
{

double a[16] =
{
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0

};

double b[16] =
{
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0
};

double c[16] =
{
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
};

int lda = 4;
int ldb = 4;
char transa = 'N';
char transb = 'N';
int ldc = 4;
int l = 4;
int m = 4;
int n = 4;

dgemul(a, lda, transa, b, ldb, transb, c, ldc, l, m, n);
int i;
for (i=0; i<16; ++i) printf("%5.10f\n", c);


return 0;
}


Thank you!
-miss fangula
 
Physics news on Phys.org
sorry, i meant the dgemul subroutine in the title, not dgemms
 
I took a quick look at lapack and didn't see a routine called dgemul included.
 
what subroutine should i call to do a matrix-matrix product?
 
Back
Top