如何在Windows上使用带有GNU工具链的BLAS?

时间:2017-09-01 16:08:56

标签: gcc rust blas openblas

我有这种依赖:

blas = "0.18.1"

在构建这个简单的程序时(程序中没有实际使用的类型):

extern crate blas;
use blas::c::*;

我收到这些错误:

error: linking with `gcc` failed: exit code: 1
  |
  = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\rpolysolve-88ff07ef5c6657b1.0.o" "-o" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\rpolysolve-88ff07ef5c6657b1.exe" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps" "-L" "C:/Users/steve/Dropbox/Projects/rpolysolve/target/debug/build/openblas-src-d878051769a2d73f/out\\opt/OpenBLAS/lib" "-L" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\libblas-b4aae95537d012fb.rlib" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\libblas_sys-e0d39b2df28e83ce.rlib" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\libopenblas_src-f69049297a7464c8.rlib" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\libnum_complex-f6dcb9467a42a2a8.rlib" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\liblibc-c8ae433ae4a960ed.rlib" "C:\\Users\\steve\\Dropbox\\Projects\\rpolysolve\\target\\debug\\deps\\libnum_traits-f34085513d19d5a6.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-5a958d157a8d8d98.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-14e8bb7ca07ebf2c.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-a4bc20050f473f79.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-892bd58ec617c3bd.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librand-ce86047000b56785.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcollections-b8b9a576d130e244.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-b9c9173c47c20c41.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc_system-141f235246f01712.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd_unicode-9fbe5d3bbc85c563.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-3a6338503b91076c.rlib" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-e9e280acad4314a4.rlib" "-Wl,-Bdynamic" "-l" "gfortran" "-l" "openblas" "-l" "advapi32" "-l" "ws2_32" "-l" "userenv" "-l" "shell32" "-Wl,-Bstatic" "-l" "gcc_eh" "-l" "pthread" "-Wl,-Bdynamic" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\\Users\\steve\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: ld: cannot find -lgfortran
          C:/Users/steve/Dropbox/Projects/rpolysolve/target/debug/build/openblas-src-d878051769a2d73f/out\opt/OpenBLAS/lib/libopenblas.a: file not recognized: File format not recognized

我的活动工具链是稳定的-x86_64-pc-windows-gnu。我想保留它,因为这是我发现的唯一调试方法; MSVC工具链不允许运行dgb,因此在CLion中进行调试。

我该怎么办? Rust和BLAS之间还有其他连接器吗?更具体地说,我需要致电dsyev_。还有其他已知的稳定方法来计算Rust中的实特征值吗?

0 个答案:

没有答案