3

I installed OpenBlas and could compile C programs linked to OpenBlas by using

 gcc testOpenBlas.c  -I /opt/OpenBLAS/include/ -L/opt/OpenBLAS/lib -lopenblas

If I try to link c++ programs using g++ and the same linker options I get the error:

testOpenBlas.cpp:1:28: fatal error: OpenBlas/cblas.h: No such file or directory
 #include <OpenBlas/cblas.h>

Any hints?

Tarek
  • 1,060
  • 4
  • 17
  • 38

2 Answers2

3

Here is what I did: I had to recompile OpenBlas again with g++. I found that the common.h file exists in the source folder, so I had to include it instead of the installation folder '/opt/OpenBlas'. I still use '-L/opt/OpenBLAS/lib' flag.

Then the problem was solved.

Tarek
  • 1,060
  • 4
  • 17
  • 38
2

This include directive is looking for the path OpenBlas/cblas.h in all your include directories, in particular also in /opt/OpenBLAS/include/.

So the question is: does there exist a file /opt/OpenBLAS/include/OpenBlas/cblas.h?

Also I think you might have to specify the -I flag before the source file.

cfh
  • 4,576
  • 1
  • 24
  • 34
  • `/opt/OpenBLAS/include/cblas.h` exists. In my code, I have also `#include `. common.h is not in the include folder however. – Tarek May 04 '15 at 17:48
  • I found that the source file should be typed before the -I flag. – Tarek May 04 '15 at 20:58