PDA

View Full Version : Linking OpenBLAS with Qt Creator project



LSantoshKSingh
7th July 2017, 18:18
I am using Qt Creator for development. I want to use Armadillo linear algebra library. Therefore I used following code in my pro file:


INCLUDEPATH += C:\armadillo-7.950.1\include

LIBS += \
-LC:\armadillo-7.950.1\examples\lib_win64 \
-llapack_win64_MT \
-lblas_win64_MT


It was all good and the project compiled and linked properly. Next task was to replace LAPACK and BLAS with OpenBLAS. So the pro file was changed as following:


INCLUDEPATH += C:\armadillo-7.950.1\include \
C:\OpenBLAS-v0.2.19-Win64-int32\include

LIBS += \
-LC:\OpenBLAS-v0.2.19-Win64-int32\lib \
-llibopenblas


Now I receive the error: LNK1104: cannot open file 'libopenblas.lib'. I have downloaded windows binary of OpenBLAS. The installed folder structure is as given in the image:
12513

Please let me know what is going wrong?

Thanks.

LSantoshKSingh
7th July 2017, 21:28
rename llibopenblas.dll.a as lib and download missing files. Works well.

d_stranz
7th July 2017, 23:05
The developers of OpenBLAS are using a non-standard naming convention for their import library. You should file a bug report against this.

LSantoshKSingh
11th July 2017, 21:35
Thanks, I will.

Infinity
15th July 2017, 19:54
The developers of OpenBLAS are using a non-standard naming convention for their import library. You should file a bug report against this.

It is quite common to use '*.dll.a' extension for import libraries when building with GCC for Windows (eg. cygwin, MSYS2, mingw-w64, ...). Only the MS compiler uses '*.lib' extension. I suppose developers of the library using GCC and hence prefer GCC convention. So I would not file a bug report.

Not sure about MS compiler, but GCC allows to specify a library just by passing its full path (without '-l'-prefix). This might be useful to avoid the problem.

BTW: You should not hardcode paths like 'C:\OpenBLAS-v0.2.19-Win64-int32\include' and 'C:\OpenBLAS-v0.2.19-Win64-int32\lib'. Try to auto-detect such paths and allow to override defaults.