JuliaPy / PyCall.jl

Package to call Python functions from the Julia language
MIT License
1.47k stars 187 forks source link

warning about BLAS.vendor being deprecated on Julia v1.7 #922

Closed jishnub closed 2 years ago

jishnub commented 2 years ago

I see the following warning on Julia 1.7 on using PyPlot (which seems to use PyCall internally):

┌ Warning: `vendor()` is deprecated, use `BLAS.get_config()` and inspect the output instead
│   caller = npyinitialize() at numpy.jl:67
└ @ PyCall ~/.julia/packages/PyCall/tqyST/src/numpy.jl:67
PyObject <matplotlib.legend.Legend object at 0x7f8a5b854e50>

Sorry I don't have a repro immediately as the warning doesn't tell me where in my code this is happening. However this is clearly arising because BLAS.vendor is deprecated.

stevengj commented 2 years ago

This is from here: https://github.com/JuliaPy/PyCall.jl/blob/5d227fc23fda631783a68c9ff1c6aff47200978e/src/numpy.jl#L67

Hopefully, this warning can just be removed in Julia 1.7, since I think #443 may finally be fixed by @staticfloat's new libtrampoline magic?

staticfloat commented 2 years ago

Mmm, it's unclear to me what the root cause of #443 is; is it that Julia configures MKL to be 64-bit and Numpy expects it to be 32-bit? If so, I guess someone needs to experiment with whether it's possible to load MKL as 32-bit and 64-bit at the same time with LBT.

stevengj commented 2 years ago

is it that Julia configures MKL to be 64-bit and Numpy expects it to be 32-bit

Yes.

It's why we were bugging Intel about getting us an ILP64 version of MKL with prefixed symbols, as you'll recall. (Are we able to use that yet?)

carstenbauer commented 2 years ago

Should we at least replace the BLAS.vendor() call with something like any(contains("mkl"), getfield.(BLAS.get_config().loaded_libs, :libname)) to avoid the deprecation message before this is checked / worked out more carefully?

devmotion commented 2 years ago

It would be good if the deprecation warning could be fixed (possibly as suggested by @carstenbauer) since the deprecation warnings break e.g. the doctests in PythonOT (https://github.com/JuliaOptimalTransport/PythonOT.jl/pull/18).