How to display the MKL version used in MKL.jl

After adding and building MKL.jl, how can I find out which version number of MKL is used? And 32-bit vs. 64-bit information?

Thanks!!

call the c function mkl_get_version_string

function mkl_get_version_string(;buf = 198)    
    vers = Vector{UInt8}(undef, buf)
    ccall((:mkl_get_version_string, "libmkl_rt"), Cvoid, (Ptr{UInt8}, Csize_t), vers, buf)
    unsafe_string(pointer(vers)) |> strip
end

println(mkl_get_version_string())

32-bit vs. 64-bit information is included in the output too, ex.

Intel(R) Math Kernel Library Version 2020.0.4 Product Build 20200917 for Intel(R) 64 architecture applications

if you need programmatically get detailed info, use the mkl_get_version function like this:

mutable struct mklv
    MajorVersion::Cint
    MinorVersion::Cint
    UpdateVersion::Cint
    ProductStatus::Cstring
    Build::Cstring
    Platform::Cstring
    Processor::Cstring
end

buf = 100
ProductStatus_s = zeros(UInt8, buf)
Build_s = zeros(UInt8, buf)
Platform_s = zeros(UInt8, buf)
Processor_s = zeros(UInt8, buf)

mkl_vers = mklv(0, 0, 0, pointer(ProductStatus_s), pointer(Build_s), pointer(Platform_s), pointer(Processor_s))
ccall((:mkl_get_version, "libmkl_rt"), Cvoid, (Ref{mklv},), Ref(mkl_vers))
mkl_vers

unsafe_string(mkl_vers.ProductStatus)
unsafe_string(mkl_vers.Build)
unsafe_string(mkl_vers.Platform)
unsafe_string(mkl_vers.Processor)
4 Likes

Thank you for your reply!

Just a tip for those on Windows like me. I had to replace “libmkl_rt” with “mkl_rt.dll”. Other than that, it works perfectly!