1

我正在尝试使用 OpenBLAS 库。我已经从http://sourceforge.net/projects/openblas/files/v0.2.14/下载了预编译的库 OpenBLAS-v0.2.14-Win64-int64.zip 。我将档案解压缩到我的 C:\ 目录。然后我尝试运行这个简单的 c 程序:

#include <cblas.h>
#include <stdio.h>

void main()
{
    int i=0;
    double A[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};         
    double B[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};  
    double C[9] = {.5,.5,.5,.5,.5,.5,.5,.5,.5}; 
    cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans,3,3,2,1,A, 3, B, 3,2,C,3);

    for(i=0; i<9; i++){
        printf("%lf ", C[i]);}
    printf("\n");
}

使用这个命令:

C:\Users\MWAHAHA\Documents\Programas>x86_64-w64-mingw32-gcc -o hello -IC:\OpenBLAS-v0.2.14-Win64-int64\include -LC:\OpenBLAS-v0.2.14-Win64-int64\lib\libopenblas -libopenblas  testeoblas.c

并收到以下消息:

C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -libopenblas
collect2.exe: error: ld returned 1 exit status

另外,如果我使用这个命令:

C:\Users\MWAHAHA\Documents\Programas>x86_64-w64-mingw32-gcc -o hello -IC:\OpenBLAS-v0.2.14-Win64-int64\includes  testeoblas.c

我收到了这条消息:

testeoblas.c:1:19: fatal error: cblas.h: No such file or directory
compilation terminated.

我正在使用 TDM-GCC-64 编译器。这可能是非常基本的,但我没有链接库的经验。我究竟做错了什么?

4

0 回答 0