JuliaLinearAlgebra / libblastrampoline

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

Use `_wgetenv` instead of `getenv` on Windows to support loading `libopenblas` from unicode paths #132

Closed thautwarm closed 4 months ago

thautwarm commented 4 months ago

In some of my applications bundling the julia runtime deps, I found that the libblastramspoline did not correctly load libopenblas as the user installed things into a unicode path.

Unlike in Unix, Windows APIs do not bypass the UTF-8 encoded strings as it is. Using _wgetenv for Windows is sufficient to solve this issue.

https://github.com/JuliaLinearAlgebra/libblastrampoline/blob/ff05ebb4e450deda0aebe8dce4d4f054e23fecfc/src/libblastrampoline.c#L453

https://github.com/JuliaLinearAlgebra/libblastrampoline/blob/ff05ebb4e450deda0aebe8dce4d4f054e23fecfc/src/env_utils.c#L6

thautwarm commented 4 months ago

Using ASCII form setenv works.