Skip to content

undefined reference to `cblas_dgemm' #3776

@johnny2231

Description

@johnny2231

Hi, I am trying to run matrix operations in C, I am coding on VScode, when I compile, it gives this message:

>> gcc testtest.c -I "C:\\Users\\experiments\\OpenBlasInstall\\include"

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\User\AppData\Local\Temp\ccsrFgiV.o:testtest.c:(.text+0x29a): undefined reference to `cblas_dgemm'
collect2.exe: error: ld returned 1 exit status

I saw an issue describing the same scenario but that is cmake issue.

I am not sure if is it related to the way I install openblas.
What I did to install openblas:

  1. download WSL(ubuntu) on window.
  2. on WSL git clone openblas, cd openblas
  3. make BINARY=64 HOSTCC=gcc CC=x86_64-w64-mingw32-gcc FC=x86_64-w64-mingw32-gfortran CFLAGS='-static-libgcc -static-libstdc++ -static -ggdb' FFLAGS='-static' && mv -f libopenblas.dll.a libopenblas.lib
  4. make PREFIX=/mnt/c/Users/experiments/OpenBlasInstall install

May I know how to solve this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions