1

I am trying to use OpenBLAS libraries. I have downloaded the pre compiled libraries OpenBLAS-v0.2.14-Win64-int64.zip from http://sourceforge.net/projects/openblas/files/v0.2.14/. I extracted the archives to my C:\ directory. Then I've tryied to run this simple c program:

#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");
}

using this command:

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

and got the following message:

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

Also, if I use this command:

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

I got this message:

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

I am using the TDM-GCC-64 compiler. This is probably very elementary, but I have no experience with linking libraries. What am I doing wrong?

Veiga
  • 212
  • 1
  • 9

1 Answers1

0

I guess you've somehow managed to compile since this was more than 6 years ago . I'll leave a comment for future solution seekers, though:

It seems that the options -I and -L don't work. Alternatively, one can define the $CPATH and $LIBRARY_PATH variables to point to the folders containing include files and library files, respectively. (at least on Linux where both methods work).

see this blog post

zs11
  • 159
  • 5