View Issue Details

IDProjectCategoryView StatusLast Update
0000482AlmaLinux-9lapackpublic2024-10-07 10:20
Reporterdeepspace9 Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
OSAlmaLinuxOS Version9.4 
Summary0000482: LAPACK and Blas library packages do not link correctly
DescriptionThe lapack and blas libraries installed from the CRB repository do not symbolically link to the correct libraries which can cause segfaults when running code linked to these libraries.
Steps To ReproduceCompile the attached c++ code using 'g++ -lblas test.cpp' and attempt to run the program. In Almalinux 8, this runs without error and prints 35. In Almalinux 9 it segfaults. This is because the shared library at /lib64/libblas.so.3 is pointing to /lib64/libblas64.so.3.9.0 (which uses 8-byte integers) instead of /lib64/libblas.so.3.9.0 (which uses 4-byte integers). Running the compiled code with LD_PRELOAD=/lib64/libblas.so.3.9.0 appears to resolve the issue. This problem is also present with lapack and cblas.
Additional InformationThis bug also appears to be present in Rocky Linux 9. I do not know if it also exists in other RHEL-based distributions.

This problem can be fixed by modifying the symbolic links for /usr/lib64/libblas.so.3 and /usr/lib64/liblapack.so.3 and /usr/lib64/libcblas.so.3 (there may be others, these are the only 3 I was using at the time)
Tagsalmalinux9, Bug, segfault
Attached Files
test.cpp (725 bytes)   
#include <iostream>
#include <vector>
#include <cstdlib>
//#include <cblas.h> // Include the CBLAS header

extern "C" {
double ddot_(const int* N, const double *X, const int* incX,
                  const double *Y, const int* incY);
}

int main() {
    // Define the size of the vectors
    const int N = 5;

    // Initialize two vectors
    std::vector<double> A = {1.0, 2.0, 3.0, 4.0, 5.0};
    std::vector<double> B = {5.0, 4.0, 3.0, 2.0, 1.0};

    // Calculate the dot product using CBLAS
    int t = 1;
    double dot_product = ddot_(&N, A.data(), &t, B.data(), &t);

    // Print the result
    std::cout << "Dot product of A and B: " << dot_product << std::endl;

    return 0;
}
//This should return a value of 35
test.cpp (725 bytes)   

Activities

pastalian

2024-10-07 10:20

reporter   ~0001069

The bug seems to have been left unaddressed for some time in CentOS Stream/RHEL.
https://issues.redhat.com/browse/RHEL-24851
https://issues.redhat.com/browse/RHEL-27271

Issue History

Date Modified Username Field Change
2024-10-04 23:15 deepspace9 New Issue
2024-10-04 23:15 deepspace9 Tag Attached: almalinux9
2024-10-04 23:15 deepspace9 Tag Attached: Bug
2024-10-04 23:15 deepspace9 Tag Attached: segfault
2024-10-04 23:15 deepspace9 File Added: test.cpp
2024-10-07 10:20 pastalian Note Added: 0001069