Skip to content

Flag BLAS++ seems not to be working properly #905

Open
@weslleyspereira

Description

@weslleyspereira

The intent of the flags BLAS++ and LAPACK++ in the building system is to build libblaspp and liblapackpp. As I understand from the CMakeLists.txt, those libraries should be linked to the local libraries libblas and liblapack, the ones we store in the directory lib. However, I found out that this does not seem to be working properly.

Below, I assume that the patch c431f75 was already applied to the master branch. Otherwise, we may end up in the problem reported at #903.

Some of my findings using the flag BLAS++=ON:

  1. If I have a BLAS library previously installed in my system, libblaspp may actually choose that BLAS library instead of the local one.
  2. If I don't have a BLAS library installed and BUILD_SHARED=ON, it will link with "-lblas" (I assume it is the local one). However, I see libblas.so.3 => not found when I run ldd libblaspp.so. I would say this is a problem, but I am not sure about that.
  3. If I don't have a BLAS library installed and BUILD_SHARED_LIBS=OFF, occasionally I get the error BLAS library not found. from BLAS++. I didn't investigate further why this only happens occasionally.

Script to reproduce the problem on a Ubuntu system:

sudo apt update
sudo apt install -y cmake gfortran git
git clone https://github.com/weslleyspereira/lapack.git
cd lapack
git checkout c431f75a4a07e4842e69c7eadc1ff73836dee668
sudo apt install -y libopenblas-dev # Comment this line if you want to test cases 2 and 3.
cmake -B build -D BUILD_TESTING=OFF -D BLAS++=ON # -D BUILD_SHARED_LIBS=ON if you want to test case 2
cmake --build build

I tested both in my personal machine and in the docker image: ghcr.io/catthehacker/ubuntu:act-latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions