簡體   English   中英

在 C++ 中使用庫“xtensor-blas”時出錯

[英]Error when using library “xtensor-blas” in C++

我一直在嘗試使用 xtensor-blas 庫,但沒有運氣。 我正在使用 Windows、G++ 8.1.0 和 MinGW-W64。 這是我嘗試一個簡單的例子:

#include <iostream>
#include "xtensor/xarray.hpp"
#include "xtensor-blas/xlinalg.hpp"

int main()
{
    xt::xarray<double> a = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
    auto d = xt::linalg::det(a);
}

這是我得到的錯誤

C:\Users\giafc\AppData\Local\Temp\cc498kqV.o:try_xtensor.cpp:(.text$_ZN9cxxlapack5getrfIiEET_S1_S1_PdS1_PS1_[_ZN9cxxlapack5getrfIiEET_S1_S1_PdS1_PS1_]+0x3f): undefined reference to `dgetrf_'
collect2.exe: error: ld returned 1 exit status

Here is the command line I issue to compile the file, where I include the Lapack header directory, I link the Lapack library (where libcblas.a is located), I include the xtensor header directory, the xtl header directory and the xtensor-blas header 目錄。

g++ try2_xtensor.cpp -std=c++14 -I C:/Users/giafc/Anaconda3/pkgs/lapack-3.6.1-h8933c1f_2/Library/include -L C:/Users/giafc/Anaconda3/pkgs/lapack-3.6.1-h8933c1f_2/Library/lib -lcblas -I C:/Users/giafc/Anaconda3/pkgs/xtensor-0.21.5-h7ef1ec2_0/Library/include -I C:/Users/giafc/Anaconda3/pkgs/xtl-0.6.13-h1ad3211_0/Library/include -I C:/Users/giafc/Anaconda3/pkgs/xtensor-blas-0.17.2-hd41736c_0/Library/include

請問有什么想法嗎?

使用vcpkg ,您可以輕松安裝openblas並對其進行鏈接。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM