# How to display the MKL version used in MKL.jl

**URL:** <https://discourse.julialang.org/t/how-to-display-the-mkl-version-used-in-mkl-jl/51137>\
**Category:** New to Julia\
**Created:** [December 2, 2020, 6:19pm UTC](https://discourse.julialang.org/t/how-to-display-the-mkl-version-used-in-mkl-jl/51137 "2020-12-02T18:19:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhong\_Pan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhong_pan/32/19872_2.png) [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Post date:** [December 2, 2020, 6:19pm UTC](https://discourse.julialang.org/t/how-to-display-the-mkl-version-used-in-mkl-jl/51137/1 "2020-12-02T18:19:20Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Post date:** [December 2, 2020, 10:13pm UTC](https://discourse.julialang.org/t/how-to-display-the-mkl-version-used-in-mkl-jl/51137/2 "2020-12-02T22:13:02Z")

</div>

call the c function [mkl\_get\_version\_string](https://software.intel.com/content/www/us/en/develop/documentation/mkl-developer-reference-c/top/support-functions/version-information/mkl-get-version-string.html)

```julia
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:

```julia
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)

```

---

<div class="post-metadata">

**Author:** ![Zhong\_Pan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhong_pan/32/19872_2.png) [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Post date:** [December 4, 2020, 6:39pm UTC](https://discourse.julialang.org/t/how-to-display-the-mkl-version-used-in-mkl-jl/51137/3 "2020-12-04T18:39:12Z")

</div>

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!
