c++armadilloopenblas

"Illegal value" of blas functions called by Armadillo


I'm using Armadillo (10.4.1) in Visual Studio 2019 to do some matrix stuff. I used OpenBlas from NuGet manager, but everything was slow. I now want to switch to an up-to-date version of OpenBlas. I took the last one (0.3.15) and compiled it with minGW following this tuto : https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio.

The compilation works fine, but when I try matrix multiplication, an error is thrown in the console : On entry to DSPR2 parameter number 1 had an illegal value

I do have defined ARMA_USE_BLAS, ARMA_DONT_USE_WRAPPER. I tried to played with ARMA_BLAS_LONG, ARMA_BLAS_UNDERSCORE, ARMA_USE_FORTRAN_HIDDEN_ARGS but nothing change.

Everything was working great using NuGet manager (OpenBlas 0.2.14.1). Here is a sample that doesn't works:

#include <armadillo>

int main(){

    arma::mat *mat1 = new arma::mat(5, 5, arma::fill::ones);
    arma::mat *mat2 = new arma::mat(5, 5, arma::fill::ones);
    arma::mat *result = new arma::mat();


    *result = *mat1 * *mat2;

    result->print();

    delete mat1, mat2, result;

    return 0;
}

Do you have any clue on what am I doing wrong ?

Thank you for your time !

Bato


Solution

  • I finally manage to fix the issue: First, I downloaded the pre compiled binary (x86) here: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.10/OpenBLAS-0.3.10-x86.zip

    I put the dll in my project folder, renamed the "libopenblas.dll.a" into "libopenblas.lib". It worked well, but was still slower than Matlab ... So I benchmarked matrix multiplication and custom functions on a fresh new x64 project (using the precompiled binaries given by Armadillo). And ... Everything is much faster !

    So I'm leaving x86 to switch to x64 ! Subject is closed!