# Best practice to make sure Julia and third-party libraries use the same MKL?

**URL:** <https://discourse.julialang.org/t/best-practice-to-make-sure-julia-and-third-party-libraries-use-the-same-mkl/83938>\
**Category:** General Usage\
**Created:** [July 8, 2022, 10:05am UTC](https://discourse.julialang.org/t/best-practice-to-make-sure-julia-and-third-party-libraries-use-the-same-mkl/83938 "2022-07-08T10:05:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsjie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jsjie/32/22477_2.png) [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Post date:** [July 8, 2022, 10:05am UTC](https://discourse.julialang.org/t/best-practice-to-make-sure-julia-and-third-party-libraries-use-the-same-mkl/83938/1 "2022-07-08T10:05:55Z")

</div>

This might be a problem of broader scope, MKL is only an example.  
I’m using [dftd4](https://github.com/dftd4/dftd4) library in my package, and a first attempt give me `Intel MKL ERROR: Parameter 4 was incorrect on entry to DSYTRF`.  
After some digging, I believe the cause is: `MKL.jl` uses ILP64 by default on 64-bit systems, and a default compilation of `dftd4` uses ip64. Forcing them to use exactly the same mkl library should fix the problem.  
However, I’m not quite sure how I should do it. I may use the mkl library in my `~/.julia/artifacts/{some_long_sha}/lib` to compile dftd4, or I can configure `MKL.jl` to use the system mkl.  
The first way seems to be less elegant, and I don’t find .pc files in julia artifacts library, so I cannot use `pkg-config` during compilation.  
The second way might seem to be better, but I would like to compile my package with `PackageCompiler.jl` and use the binary in another machine, and I’m not quite sure whether this way will be less relocatable?
