Community
cancel
Showing results for 
Search instead for 
Did you mean: 
John_Young
New Contributor I
92 Views

Determingine MKL version number during compile

Hi,

Does MKL #define anything that indicate its version number and that can be seen by the preprocessor during a compile (C/C++)? Some function definitions seem to have changed between MKL 10.1 and 10.2. For example, the LAPACK function 'cpptrf' changed from

cpptrf(char*, int*, float*, int*)

to

cpptrf(char*,int*,(MKL_Complex8*),int*)

Right now we have the user explicitly set a #define before comple to indicate which mkl version they have, but it would be nice if we could key off something that is set by MKL itself.

Thanks,
John
0 Kudos
6 Replies
mecej4
Black Belt
92 Views

Look up the functions MKL_Get_Version() and MKL_Get_Version_String().
John_Young
New Contributor I
92 Views

I am aware of those functions, but those are at run time. I would like to #ifdef things at compile time depending on the MKL version.

John
mecej4
Black Belt
92 Views

In that case, why not insert your own version symbol into, say, mkl.h ? If needed, a comparison of the value of this preprocessor symbol to the return value of MKL_Get_Version() could be put in your initialization code as a sanity check .
barragan_villanueva_
Valued Contributor I
92 Views

Hi,

Thanks for your suggestion.Introducing kind of MKL_VERSION macro into would be very helpful but only for C/C++ users.
John_Young
New Contributor I
92 Views

That would be one solution. However, some users do not have write access to MKL libraries on the systems they are using.

John_Young
New Contributor I
92 Views

Victor,

That would be great if some macros could be added.

I am not sure if the Fortran libraries suffer from the same problem that the C/C++ libraries do, so maybe having the version available at compile time is not as useful on the Fortran side. For example, the C/C++ interface of 'cpptrf' changed between versions 11.1 and 11.2. I do not think (but I have not checked) the Fortran interface for this particular function changed between 11.1 and 11.2. I suppose subroutine interface changes could happen in the Fortran libraries as well though.

That being said, if you want to make a macro available to Fortran users who do actually pre-process their files, you could create a separate header such as 'mkl_version.h'. Inside 'mkl_version.h' would only exist #define macros. That way a Fortran user who is using pre-processing could still #include it.

Thanks,
John
Reply