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

static link c lib openblas error on windows 10 #80

Open
zhongyi51 opened this issue Nov 8, 2021 · 1 comment
Open

static link c lib openblas error on windows 10 #80

zhongyi51 opened this issue Nov 8, 2021 · 1 comment

Comments

@zhongyi51
Copy link

zhongyi51 commented Nov 8, 2021

os: windows 10 professional 19042.1288
vcpkg version: 2021-11-02-af04ebf6274fd6f7a941bff4662b3955c64f6f42 (newest from github)
openblas-src version: 0.10 (vcpkg: openblas_x64-windows-static-md)
dependencies of project:
ndarray = { version = "0.15.0", features = ["blas"] } blas-src = { version = "0.8", features = ["openblas"] } openblas-src = { version = "0.10", features = ["system","static"] }

=============================================================
Hello... I think I met a link problem when I tried to link the openblas to my rust project on windows.
I am wondering whether I use the improper version of MSVC tools.

The error message is:

**error: linking with link.exe failed: exit code: 1120
|
= note: "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702\bin\HostX64\x64\link.exe" "/NOLOGO" "E:\code\rust\classgameground\target\release\deps\classgameground.classgamegr
ound.a04f6f11-cgu.0.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.1.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04
f6f11-cgu.10.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.11.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-
cgu.12.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.13.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.14
.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.15.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.2.rcgu.o
" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.3.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.4.rcgu.o" "E:\c
ode\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.5.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.6.rcgu.o" "E:\code\rus
t\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.7.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.8.rcgu.o" "E:\code\rust\class
gameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.9.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.10f8x2h4m3hb46jx.rcgu.o" "/LIBPATH:E:\code\rust\classgameground\t
arget\release\deps" "/LIBPATH:C:\vcpkg\vcpkg\installed\x64-windows-static\lib" "/LIBPATH:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "E:\code\rust\classga
meground\target\release\deps\libndarray-c486250c6ce0ed21.rlib" "E:\code\rust\classgameground\target\release\deps\libmatrixmultiply-1d3116217c223bb8.rlib" "E:\code\rust\classgameground\target\release\deps\libnum_com
plex-44a028268c07187d.rlib" "E:\code\rust\classgameground\target\release\deps\libnum_integer-a6c20d79817f2641.rlib" "E:\code\rust\classgameground\target\release\deps\libnum_traits-e11902e9df7507af.rlib" "E:\code\rust
\classgameground\target\release\deps\librawpointer-06a9340878966269.rlib" "E:\code\rust\classgameground\target\release\deps\libcblas_sys-21536f50fb239890.rlib" "E:\code\rust\classgameground\target\release\deps\lib
libc-3fc6a63652eea851.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-ac1aca38635ef0b8.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windo
ws-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libpanic_unwind-c3aa48ffdde66347.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd_detect-e191adc26f6fc9
3a.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_demangle-cd2025f252bca17e.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc
\lib\rustlib\x86_64-pc-windows-msvc\lib\libhashbrown-a1b8bc9fb8cfdc18.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_alloc-32dec5d0d5
e8f2c4.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libunwind-dd20fc17f8fe4af1.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib
\rustlib\x86_64-pc-windows-msvc\lib\libcfg_if-bb4c152a3ade13b7.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liblibc-ed0b50a02b1f754a.rlib" "C:\Users\l1z
3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liballoc-e1d125b3a421e009.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-
msvc\lib\librustc_std_workspace_core-2abf9a74f22d740a.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-f309332ab230c371.rlib" "C:\Users\l1z3\.rustup
\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcompiler_builtins-55394bc732b75eeb.rlib" "kernel32.lib" "ws2_32.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LI
BPATH:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "/OUT:E:\code\rust\classgameground\target\release\deps\classgameground.exe" "/OPT:REF,ICF" "/DEBUG" "/NATVI
S:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C
:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libstd.natvis"
= note: classgameground.classgameground.a04f6f11-cgu.0.rcgu.o : error LNK2019: unresolved external symbol cblas_dgemm referenced in function _ZN7ndarray6linalg11impl_linalg12mat_mul_impl17hf56d101a94a3760aE
E:\code\rust\classgameground\target\release\deps\classgameground.exe : fatal error LNK1120: 1 unresolved externals

warning: classgameground (bin "classgameground") generated 2 warnings
error: could not compile classgameground due to previous error; 2 warnings emitted**

===============================================================
Thanks for you help.

@bluss
Copy link
Contributor

bluss commented Nov 13, 2021

Does it work with ndarray 0.14? See ndarray Readme for version instructions. This would actually be helpful information.

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

No branches or pull requests

3 participants