View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000482 | AlmaLinux-9 | lapack | public | 2024-10-04 23:15 | 2024-10-07 10:20 |
| Reporter | deepspace9 | Assigned To | |||
| Priority | low | Severity | minor | Reproducibility | always |
| Status | new | Resolution | open | ||
| OS | AlmaLinux | OS Version | 9.4 | ||
| Summary | 0000482: LAPACK and Blas library packages do not link correctly | ||||
| Description | The 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 Reproduce | Compile 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 Information | This 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) | ||||
| Tags | almalinux9, 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
| ||||
|
|
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 |
| 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 |