From 85a11cd3a7aea8d5e8aed5c6f2e3e56b83fcde86 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 3 Mar 2022 06:52:09 +0000 Subject: [PATCH] Avoid deprecated BLAS.vendor() in MKL conflict check (#950) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch as suggested by Carsten Bauer in #922. GitHub: Fixes #922. Co-authored-by: Mosè Giordano --- src/numpy.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/numpy.jl b/src/numpy.jl index f3d523aa..1f96e4cb 100644 --- a/src/numpy.jl +++ b/src/numpy.jl @@ -64,8 +64,12 @@ function npyinitialize() numpy = pyimport("numpy") # emit a warning if both Julia and NumPy are linked with MKL (#433) - if LinearAlgebra.BLAS.vendor() === :mkl && - LinearAlgebra.BLAS.BlasInt === Int64 && hasproperty(numpy, "__config__") + julia_mkl = @static if VERSION < v"1.7" + LinearAlgebra.BLAS.vendor() === :mkl + else + any(contains("mkl"), getfield.(LinearAlgebra.BLAS.get_config().loaded_libs, :libname)) + end + if julia_mkl && LinearAlgebra.BLAS.BlasInt === Int64 && hasproperty(numpy, "__config__") config = numpy."__config__" if hasproperty(config, "blas_opt_info") blaslibs = get(config."blas_opt_info", Vector{String}, "libraries", String[])