libblastrampoline icon indicating copy to clipboard operation
libblastrampoline copied to clipboard

Error: no BLAS/LAPACK library loaded!

Open liushang0322 opened this issue 2 years ago • 4 comments

julia> if Base.USE_BLAS64
           # Load ILP64 forwards
           BLAS.lbt_forward(libkmlblas; clear=true, suffix_hint="64")
           # Load LP64 forward
           BLAS.lbt_forward(libkmlblas; suffix_hint="")
       else
           BLAS.lbt_forward(libkmlblas; clear=true, suffix_hint="")
       end
325

julia> BLAS.get_config()
LinearAlgebra.BLAS.LBTConfig
Libraries: 
└ [ LP64] libkblas.so

julia> Base.USE_BLAS64
true

julia> 

julia> 

julia> 

julia> aa * bb
Error: no BLAS/LAPACK library loaded!

Sorry to bother you, I'm trying to use BLAS.lbtforward to implement my own BLAS switching. I wrote a BLAS library and installed Julia on an arm-based machine. I didn't use BinaryBuilder to build my binary files. Instead, build the link library directly on this machine as shown in the code below, and successfully use the BLAS.lbtforward function to link to my link library, but when I call multiplication, the following error occurs, my library is based on MKL-BLAS The specification was written, and the switching method has also reached an agreement with MKL.jl. Please tell me where the problem lies.

liushang0322 avatar Nov 17 '22 03:11 liushang0322

In order to be able to connect to libblastranspoline, is it necessary to add some APIs in BLAS to achieve the effect of switching BLAS? If yes, can you provide a document link or an example?

liushang0322 avatar Nov 17 '22 03:11 liushang0322

@liushang0322 You need to provide an ILP64 BLAS if you want that aa * bb uses your BLAS with a precompiled Julia. LP64 BLAS are generally used to replace OpenBLAS32_jll when an artifact is compiled with LBT.

amontoison avatar Nov 28 '22 20:11 amontoison

Thank you very much for your reply. What I understand is that the symbol table needs to be switched. Is there a simple and fast way to run the script to perform such an operation?

liushang0322 avatar Nov 29 '22 00:11 liushang0322

To my knowledge, it's not possible at the moment: https://github.com/JuliaLang/julia/issues/43304 We can't use Apple Accelerate for instance because it is a LP64 BLAS.

amontoison avatar Nov 29 '22 00:11 amontoison

@liushang0322 Sorry for such a late reply, I unfortunately don't see these issues unless I get pinged directly via @staticfloat.

It looks to me like your ILP64 load failed; can you pass verbose=true to the lbt_forward() calls, so we can see what it thinks about your forwarding commands?

staticfloat avatar Feb 07 '23 03:02 staticfloat

Please try the latest AppleAccelerate.jl: https://discourse.julialang.org/t/appleaccelerate-jl-v0-4-0/99351

ViralBShah avatar May 24 '23 21:05 ViralBShah