cannot get 'zgemm3m' to work

cannot get 'zgemm3m' to work

I am integrating the MKL library into a C++ application (developed using Microsoft VS 2005) that I am working on. I have used the zgemm function with no issues but when i try to use the zgemm3m function it gives the compiler error 'zgemm3m': identifier not found.

I am using the Intel MKL 10.1.0.018.
The header file I have included is mkl_blas.h and the libraries I have inlcuded in the project properties are,
libiomp5mt.lib
mkl_sequential.lib
mkl_intel_c.lib
mkl_core.lib
mkl_s.lib
mkl_c.lib

I don't understand if I am missing a header file (or) am I not including the appropriate library (or) is there some other issue that i am unaware of?

Any help is appreciated.
Thanks.

sathya
14 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - sathya_
I am integrating the MKL library into a C++ application (developed using Microsoft VS 2005) that I am working on. I have used the zgemm function with no issues but when i try to use the zgemm3m function it gives the compiler error 'zgemm3m': identifier not found.

I am using the Intel MKL 10.1.0.018.
The header file I have included is mkl_blas.h and the libraries I have inlcuded in the project properties are,
libiomp5mt.lib
mkl_sequential.lib
mkl_intel_c.lib
mkl_core.lib
mkl_s.lib
mkl_c.lib

Not directly answering your question, but you seem to have some redundancy in your libraries. With mkl_sequential, you shouldn't need libiomp5 (unless you have parallel somewhere else in your application). There is no mkl_s or mkl_c in my current version. mkl_intel_s would be for use with Compaq Fortran, I believe, and is exclusive of mkl_intel_c.

Quoting - tim18
Not directly answering your question, but you seem to have some redundancy in your libraries. With mkl_sequential, you shouldn't need libiomp5 (unless you have parallel somewhere else in your application). There is no mkl_s or mkl_c in my current version. mkl_intel_s would be for use with Compaq Fortran, I believe, and is exclusive of mkl_intel_c.

Tim pointed out some of your problems. It really seems you tried to link everything provided. If you use CDECL then link with mkl_c.lib, and libiomp5 for RTL layer. Your declaration suggests IA32 system, right?

Did you define the call correctly, include all interfaces? (argument types, dimensions etc.?) You need to show (some of) the code to get more help.

A.

Quoting - tim18
Not directly answering your question, but you seem to have some redundancy in your libraries. With mkl_sequential, you shouldn't need libiomp5 (unless you have parallel somewhere else in your application). There is no mkl_s or mkl_c in my current version. mkl_intel_s would be for use with Compaq Fortran, I believe, and is exclusive of mkl_intel_c.

tim18,

Actually I did not include/add any of these libraries (except mkl_c.lib, which I added) explicitly. When you select a project in the solution explorer (in Microsoft VS 2005), right click on it and then click on 'Intel MKL Project Settings' and then selecting 'Add Intel MKL 10.1.0.018' automatically adds the libraries to my project settings.

thanks.

sathya

Quoting - ArturGuzik

Tim pointed out some of your problems. It really seems you tried to link everything provided. If you use CDECL then link with mkl_c.lib, and libiomp5 for RTL layer. Your declaration suggests IA32 system, right?

Did you define the call correctly, include all interfaces? (argument types, dimensions etc.?) You need to show (some of) the code to get more help.

A.

ArturGuzik,

Yes it is a IA32 system. And I have pasted a sample code that I wrote to demonstrate what my issue is,

#include "mkl.h"
#include 
using namespace std;

#define N 5

void main()
{
	int n, inca = 1, incb = 1, i, j;

	MKL_Complex16 a[N*N];
	MKL_Complex16 b[N*N];
	MKL_Complex16 c[N*N];
	MKL_Complex16 Result[N*N];
	MKL_Complex16 one;
	MKL_Complex16 zero;

	n = N;
	char ch;
	ch = 'T';

	one.real = (double)1.0;
	one.imag = (double)0.0;

	zero.real = (double)0.0;
	zero.imag = (double)0.0;

	for( i = 0; i < n; i++ )
	{	
		for( j = 0; j < n; j++ )
		{
			a[i*n+j].real = (double)i; 
			a[i*n+j].imag = (double)i * 2.0;
			b[i*n+j].real = (double)(n - i); 
			b[i*n+j].imag = (double)i * 2.0;
		}
	}

	zgemm(&ch,&ch,&n,&n,&n,&one,a,&n,b,&n,&zero,c,&n);

	for( i = 0; i < n; i++ )
	{	
		for( j = 0; j < n; j++ )
		{
			Result[j*n+i].real = c[i*n+j].real;
			Result[j*n+i].imag = c[i*n+j].imag;
		}
	}

	zgemm3m(&ch,&ch,&n,&n,&n,&one,a,&n,b,&n,&zero,c,&n);
	
	getchar();
}


When you compile this code it says error C3861: 'zgemm3m': identifier not found so not even going as far as whether the arguments of the function are correct, the function name itself doesn't seem to be recognized. On the other hand zgemm seems to be working fine.

Incidentally I opened the mkl_blas.h file and it doesn't have a zgemm3m function interface definiton in there, so I don't know what to make of that?

Thanks.

sathya

Quoting - sathya_
When you compile this code it says error C3861: 'zgemm3m': identifier not found so not even going as far as whether the arguments of the function are correct, the function name itself doesn't seem to be recognized. On the other hand zgemm seems to be working fine.

Incidentally I opened the mkl_blas.h file and it doesn't have a zgemm3m function interface definiton in there, so I don't know what to make of that?

Thanks.

Hi,

you're correct, zgemm3m is NOT defined there (thus the symbols not found error), and looks as a (at least) documentation error (Tim, is this the case?). You can find the interface and routine in CBLAS library, though.

void cblas_zgemm3m(const  CBLAS_ORDER Order, const  CBLAS_TRANSPOSE TransA, const  CBLAS_TRANSPOSE TransB, const MKL_INT M, const MKL_INT N,
const MKL_INT K, const void *alpha, const void *A, const MKL_INT lda, const void *B, const MKL_INT ldb, const void *beta, void *C, const MKL_INT ldc);

(as well as zgemm). You also have example on disk cblas_zgemm3mx.c, which works for me.

A.

Sathya,

probably it will more helpful to look at the "C" version of zgemm3m function into cblas_zgemm3mx.c example ( see folder examplescblassource )
The linking line ( static mode, ia32 ): mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib
--Gennady

Quoting - ArturGuzik

Hi,

you're correct, zgemm3m is NOT defined there (thus the symbols not found error), and looks as a (at least) documentation error (Tim, is this the case?). You can find the interface and routine in CBLAS library, though.

void cblas_zgemm3m(const  CBLAS_ORDER Order, const  CBLAS_TRANSPOSE TransA, const  CBLAS_TRANSPOSE TransB, const MKL_INT M, const MKL_INT N,
const MKL_INT K, const void *alpha, const void *A, const MKL_INT lda, const void *B, const MKL_INT ldb, const void *beta, void *C, const MKL_INT ldc);

(as well as zgemm). You also have example on disk cblas_zgemm3mx.c, which works for me.

A.

Hi ArturGuzik,

I did end up using the C interface to call both these functions, and both of them work.
But its strange that the C interface for the zgemm3m function is defined but the actual FORTRAN interface isnt?

Thanks for all your help.

sathya

Quoting - Gennady Fedorov (Intel)

Sathya,

probably it will more helpful to look at the "C" version of zgemm3m function into cblas_zgemm3mx.c example ( see folder examplescblassource )
The linking line ( static mode, ia32 ): mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib
--Gennady

Gennady,

I did use the C version of the zgemm and zgemm3m functions, and they work perfectly.

Correct me if I am wrong, but if the C interface works doesnt it mean its calling the FORTRAN interface from somehwhere inside that C function? I am just curious here, does this mean that its a documentation mistake (or) was no interface definition provided in the mkl_blas.h file?

Also what would be the equivalent linking line if i wanted to run this code on a 64 bit system?

Thanks for the help.

sathya

Sathya,
>> Thanks for pointing us this problem. This is the Documentation error regarding cgemm3m and zgemm3m description.
Really, both of these routines API you can find only in mkl_cblas.h and we have to add these interfaces to the mkl_blas.fi for FORTRAN 77 and mkl_blas.f90 files.

>> doesnt it mean its calling the FORTRAN interface from somehwhere inside that C function?
No. We support Fortran interfaces described into manual. Moreover We have Fortran base examples for this kind of functionality ( a mean cgemm3m and zgemm3m ) - please see
..examplesblassource cgemm3mx.f and zgemm3mx.f files how to use both of these routines.

>> Also what would be the equivalent linking line if i wanted to run this code on a 64 bit system?
Yes. Please look at the linking your application chapter into MKL userguide. As an example for win64, static mode, we recommend to use the following libraries:
mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib
see more info into userguide.
--Gennady

Quoting - Gennady Fedorov (Intel)
>> Also what would be the equivalent linking line if i wanted to run this code on a 64 bit system?

Yes. Please look at the linking your application chapter into MKL userguide. As an example for win64, static mode, we recommend to use the following libraries:
mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib
see more info into userguide.
--Gennady

Gennady,

I am trying to make a build for a 64-bit system and I used mkl_intel_lp64.lib library and the error message i get is,

mkl_intel_lp64.lib(cblas_zgemm_lp64.obj) : fatal error LNK1112: module machine type 'IA64' conflicts with target machine type 'x64'

I do know there is a difference between IA64 and x64 (also called as Intel 64, right?)...So is there a different library for x64 target machine types. I have read the documentation and am not able to figure which library I need to be using.

Thanks.

sathya

Quoting - sathya_

I am trying to make a build for a 64-bit system and I used mkl_intel_lp64.lib library and the error message i get is,

mkl_intel_lp64.lib(cblas_zgemm_lp64.obj) : fatal error LNK1112: module machine type 'IA64' conflicts with target machine type 'x64'

The designations X64, AMD64, EM64T, intel64, and possibly 32e are equivalent. So you should have MKL libraries in a directory em64t or intel64 which match your platform.

Quoting - tim18
The designations X64, AMD64, EM64T, intel64, and possibly 32e are equivalent. So you should have MKL libraries in a directory em64t or intel64 which match your platform.

Hello tim,

The library name was correct but the location where it was looking for the library was wrong. I had to change the location (it was pointing to C:Program FilesIntelMKL10.1.0.018ia64lib which has library files for IA64 systems) to point to em64t folder under (right click on project in solution explorer in VS2005 and select)
properties->configuration properties -> linker->general->additional library dependencies->C:Program FilesIntelMKL10.1.0.018em64tlib

Thanks.

sathya

Quoting - sathya_

Hi ArturGuzik,

I did end up using the C interface to call both these functions, and both of them work.
But its strange that the C interface for the zgemm3m function is defined but the actual FORTRAN interface isnt?

Thanks for all your help.

Sathya,
Just for your info:
z(c)gemm3m interfaces were added to the blas.g90 and mkl_blas.fi header files.You can find these fixes into MKL 10.2 we released yesterday.
This version available for download from intel registration center: "https://registrationcenter.intel.com/

--Gennady

Leave a Comment

Please sign in to add a comment. Not a member? Join today