#948954 libblis2-pthread: undefined symbol: openblas_set_num_threads

#948954#5
Date:
2020-01-15 09:15:14 UTC
From:
To:
Dear Debian Science Team,

when trying to exchange libblis2-pthread for libopenblas0-pthread,
I get the following error from a self compiled program (using libopenblas-dev):

  /usr/lib/x86_64-linux-gnu/libblas.so.3: undefined symbol: openblas_set_num_threads

The library is actually /usr/lib/x86_64-linux-gnu/blis-pthread/libblas.so.3.

I'm not quite sure which package is to blame for this and if the
libraries are intended to be interchangeable at all.
Can you help me?

Regards,
Jörg.

#948954#10
Date:
2021-05-25 12:39:00 UTC
From:
To:
Hi Jörg, your error refers to openblas, which is a separate BLAS
implementation from blis.  The implementations are compatible, but
only when built against libblas.so using -lblas, i.e. when using the
common BLAS ABI.

The appearance of the openblas symbol suggests that your applications
were built using -lopenblas instead of -lblas, enabling some
openblas-specific symbols to be called in.

You've got two options,

1) rebuild your binaries (and to protect from the same problem in the
   future, ensure they link strictly against -lblas)

2) install OpenBLAS instead of BLIS (e.g. install libopenblas-pthread-dev)
   Together with that you'd probably want to check that the blas
   alternatives match, running both
     sudo update-alternatives --config libblas.so-x86_64-linux-gnu`
   *and*
     sudo update-alternatives --config libblas.so.3-x86_64-linux-gnu