我正在尝试使用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编译器。 这可能非常基础,但我没有链接库的经验。我做错了什么?