3

I have installed OpenBlas in TX1 and the time_dgemm example compiles fine with the gcc. However, I need to be able to link the rest of my code with OpenBlas using g++. When I try to compile the time_dgemm example with g++ it fails, giving the linking error "...undefined reference to 'dgemm_(......". The only change is using the g++ instead of gcc.

I have tried to compile the OpenBLAS library with g++ (make CC=g++), as other people suggested in the past, but the compilation fails when it tries to compile some part of BLAS.

Any ideas?

  • 2
    Did you add `-Lpath_to_openblas_lib_directory -lopenblas` to your gcc command (as said in https://github.com/xianyi/OpenBLAS - [Usages](https://github.com/xianyi/OpenBLAS#usages))? – osgx Jun 27 '16 at 14:29
  • 3
    If the **only** difference is using g++ vs gcc: https://github.com/xianyi/OpenBLAS/issues/21 – n. m. could be an AI Jun 27 '16 at 16:04
  • The path to the lib directory and -lopenblas is there. The only difference is the gcc and g++. Also, I looked into issue 21, but this has already been addressed in the new versions of openblas. I am using 0.2.18. – Christos Bouganis Jun 28 '16 at 07:55
  • 2
    Where is `dgemm_` declared? Is the declaration wrapped in `extern "C"`? If you have declared `dgemm_` yourself, you need to use `extern "C"` yourself. – n. m. could be an AI Jun 28 '16 at 14:20

1 Answers1

1

If some people have the same issue, I was able to compile with the following command:

g++ openBlasExample.cpp  -I /usr/include/openblas -lopenblas

You can find your openblas include folder by using on Linux:

locate openblas

More info here:

https://gist.github.com/xianyi/6930656

supercheval
  • 357
  • 3
  • 8