JuliaLinearAlgebra / libblastrampoline

Using PLT trampolines to provide a BLAS and LAPACK demuxing library.
MIT License
66 stars 17 forks source link

Add fallback search for extra-underscore-suffixed symbols #137

Closed staticfloat closed 2 months ago

staticfloat commented 2 months ago

MKL v2024 has ILP64-suffixed symbols, but the suffix applied to FORTRAN symbols (64, mapping dgemm_ to dgemm_64) is different from the suffix applied to non-FORTRAN symbols (_64, mapping cblas_dgemm to cblas_dgemm_64). This wreaks havoc with LBT, which assumes that all symbols undergo the same name transformation. To work around this, we add a fallback path to our symbol forwarding routine; if a symbol does not exist in a library, we look for the same symbol but with an underscore in front of the symbol name. Because this all happens only after we have already found isamax_ and dpotrf_ in autodetect_symbol_suffix(), we have some measure of assurance that we will not be blindly guessing ridiculous symbol names.

ViralBShah commented 2 months ago

We'll need this version of LBT backported to 1.11 and 1.10. cc @KristofferC

staticfloat commented 2 months ago

This isn't in Kristoffer's court yet; I need to finish this LBT release, push it through Yggdrasil, open a PR to Julia master, then tag it for backporting. :)

ViralBShah commented 2 months ago

Yes, perhaps tagging him was premature - but it would be nice to get this into 1.11 and hence the heads up.