Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error LNK2019: unresolved external symbol zgtcon_ under Windows #369

Open
Danvil opened this issue Jan 20, 2024 · 4 comments
Open

error LNK2019: unresolved external symbol zgtcon_ under Windows #369

Danvil opened this issue Jan 20, 2024 · 4 comments

Comments

@Danvil
Copy link

Danvil commented Jan 20, 2024

I cannot get any of the backends to work under Windows.

For example using this configuration from the docs:

ndarray = { version = "0.15", features = ["blas"] }
ndarray-linalg = { version = "0.16", features = ["openblas-system"] }
blas-src = { version = "0.8", features = ["openblas"] }
openblas-src = { version = "0.10", features = ["cblas", "system"] }

Gives a whole lot of errors like this:

liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.03.rcgu.o) : error LNK2019: unresolved external symbol dgetrf_ referenced in function _ZN42_$LT$f64$u20$as$u20$lax..solve..Solve_$GT$2lu17h8cc9d17e97b9b466E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.03.rcgu.o) : error LNK2019: unresolved external symbol dgetri_ referenced in function _ZN42_$LT$f64$u20$as$u20$lax..solve..Solve_$GT$3inv17h096ce6e5710b8066E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.03.rcgu.o) : error LNK2019: unresolved external symbol dgetrs_ referenced in function _ZN42_$LT$f64$u20$as$u20$lax..solve..Solve_$GT$5solve17hb4d0f0ef88c9dd0bE
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.03.rcgu.o) : error LNK2019: unresolved external symbol sgetrf_ referenced in function _ZN42_$LT$f32$u20$as$u20$lax..solve..Solve_$GT$2lu17h3a75841395bba5e5E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.03.rcgu.o) : error LNK2019: unresolved external symbol sgetri_ referenced in function _ZN42_$LT$f32$u20$as$u20$lax..solve..Solve_$GT$3inv17hebe6cbee16776c02E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.03.rcgu.o) : error LNK2019: unresolved external symbol sgetrs_ referenced in function _ZN42_$LT$f32$u20$as$u20$lax..solve..Solve_$GT$5solve17h98dce934d429840bE
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol dpotrf_ referenced in function _ZN48_$LT$f64$u20$as$u20$lax..cholesky..Cholesky_$GT$8cholesky17hbcc7fbf2610d8523E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol dpotri_ referenced in function _ZN48_$LT$f64$u20$as$u20$lax..cholesky..Cholesky_$GT$12inv_cholesky17h23c7bb8ca119a2bfE
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol dpotrs_ referenced in function _ZN48_$LT$f64$u20$as$u20$lax..cholesky..Cholesky_$GT$14solve_cholesky17ha567abc93f95bb69E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol spotrf_ referenced in function _ZN48_$LT$f32$u20$as$u20$lax..cholesky..Cholesky_$GT$8cholesky17ha2680083fd453484E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol spotri_ referenced in function _ZN48_$LT$f32$u20$as$u20$lax..cholesky..Cholesky_$GT$12inv_cholesky17h96252b7f76feeeb9E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol spotrs_ referenced in function _ZN48_$LT$f32$u20$as$u20$lax..cholesky..Cholesky_$GT$14solve_cholesky17h2a142dfa26637ff5E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol sgecon_ referenced in function _ZN42_$LT$f32$u20$as$u20$lax..rcond..Rcond_$GT$5rcond17h9f1fa84c873f25c2E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol dgecon_ referenced in function _ZN42_$LT$f64$u20$as$u20$lax..rcond..Rcond_$GT$5rcond17hd8a6b762a0b6e628E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol dsytrf_ referenced in function _ZN44_$LT$f64$u20$as$u20$lax..solveh..Solveh_$GT$2bk17he1b7c12a243d9e97E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol dsytri_ referenced in function _ZN44_$LT$f64$u20$as$u20$lax..solveh..Solveh_$GT$4invh17hb63043fb21827910E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol dsytrs_ referenced in function _ZN44_$LT$f64$u20$as$u20$lax..solveh..Solveh_$GT$6solveh17h25636291622d8985E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol ssytrf_ referenced in function _ZN44_$LT$f32$u20$as$u20$lax..solveh..Solveh_$GT$2bk17h1c687d53291eda0bE
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol ssytri_ referenced in function _ZN44_$LT$f32$u20$as$u20$lax..solveh..Solveh_$GT$4invh17h35c98be9db5fc776E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.05.rcgu.o) : error LNK2019: unresolved external symbol ssytrs_ referenced in function _ZN44_$LT$f32$u20$as$u20$lax..solveh..Solveh_$GT$6solveh17h767dbd594dd51f44E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.04.rcgu.o) : error LNK2019: unresolved external symbol dlange_ referenced in function _ZN50_$LT$f64$u20$as$u20$lax..opnorm..OperatorNorm_$GT$6opnorm17haf9e9d197af3e491E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.04.rcgu.o) : error LNK2019: unresolved external symbol slange_ referenced in function _ZN50_$LT$f32$u20$as$u20$lax..opnorm..OperatorNorm_$GT$6opnorm17h0fe0ff3a25f1f35dE
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.04.rcgu.o) : error LNK2019: unresolved external symbol dtrtrs_ referenced in function _ZN52_$LT$f64$u20$as$u20$lax..triangular..Triangular_$GT$16solve_triangular17hb37784c34d361c45E
liblax-6415d9dcbfb7d3a7.rlib(lax-6415d9dcbfb7d3a7.lax.72adf86f048c75b1-cgu.04.rcgu.o) : error LNK2019: unresolved external symbol strtrs_ referenced in function _ZN52_$LT$f32$u20$as$u20$lax..triangular..Triangular_$GT$16solve_triangular17hd2a014e815dfb84fE

I have openblas installed with vcpkg and the linker command produced by cargo build contains these entries:

...
"/LIBPATH:I:\\vcpkg\\installed\\x64-windows\\lib"
"/LIBPATH:I:\\vcpkg\\installed\\x64-windows\\bin"
...
"openblas.lib"
...
@relf
Copy link

relf commented Jan 20, 2024

Did you try the intel-mkl-static backend? On Windows, it works for me with:

ndarray = { version = "0.15", features = ["blas"] }
ndarray-linalg = { version = "0.15", features = ["intel-mkl-static"] }

@Danvil
Copy link
Author

Danvil commented Jan 20, 2024

It looks like these symbols are missing from the openblas.dll which vcpkg installed.

For example the linker complains about missing dgetrf_, dgetri_ and dgetrs_ and when I look at the symbols in the DLL the closest match I can find are dger_ and dger_k.

@Danvil
Copy link
Author

Danvil commented Jan 20, 2024

I downloaded the release package from the OpenBLAS repository. The DLL compiled by vcpkg is suspiciously small (only 1.7 MB) while the DLL from the OpenBLAS repo is 50MB.

When I replaced the files produced by vcpkg with the ones from OpenBLAS the linker errors went away and my program is working.

@Danvil
Copy link
Author

Danvil commented Jan 20, 2024

@relf It didn't work when I tried it the first time..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants