Bug 2058840

Summary: flexiblas not properly linked to libgfortran
Product: Red Hat Enterprise Linux 9 Reporter: Mattias Ellert <mattias.ellert>
Component: flexiblasAssignee: Matej Mužila <mmuzila>
Status: CLOSED DUPLICATE QA Contact: RHEL CS Apps Subsystem QE <rhel-cs-apps-subsystem-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: CentOS StreamCC: amoralej, bstinson, jwboyer, nforro
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-01 14:53:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2059049    

Description Mattias Ellert 2022-02-26 06:49:34 UTC
Description of problem:

Flexiblas is not properly linked to libgfortran.
This can be seen when trying to import numpy into python.

<mock-chroot> sh-5.1# python3 -c "import numpy as n"
flexiblas dlopen: /usr/lib64/flexiblas//libflexiblas_fallback_lapack.so: undefined symbol: _gfortran_transfer_character_write
flexiblas  Failed to load the LAPACK fallback library.  Abort!
Aborted (core dumped)

If libgfortran is preloaded the import works:

<mock-chroot> sh-5.1# LD_PRELOAD=/usr/lib64/libgfortran.so.5 python3 -c "import numpy as n; print(n.__version__);"
1.20.1

Version-Release number of selected component (if applicable):

<mock-chroot> sh-5.1# rpm -q flexiblas python3 python3-numpy
flexiblas-3.0.4-7.el9.x86_64
python3-3.9.10-2.el9.x86_64
python3-numpy-1.20.1-5.el9.x86_64

How reproducible:
Always

Steps to Reproduce:
1. python3 -c "import numpy as n"

Actual results:
Failure due to undefined symbols

Expected results:
Successful import

Additional info:

ldd -r /usr/lib64/flexiblas/libflexiblas_fallback_lapack.so
lists many undefined symbols.
However, this is also true for the Fedora version.

But, in Fedora this is saved by over-linking in the main flexiblas library;
[ellert@localhost ~]$ ldd -u /usr/lib64/libflexiblas.so.3
Unused direct dependencies:
	/lib64/libm.so.6
	/lib64/libgfortran.so.5
	/lib64/libquadmath.so.0

These are not there in RHEL 9, which is probably correct. But it exposes the underlinking of /usr/lib64/flexiblas/libflexiblas_fallback_lapack.so (and /usr/lib64/flexiblas64/libflexiblas_fallback_lapack.so).

Comment 1 Mattias Ellert 2022-02-27 09:50:05 UTC
To fix this in a simple way, add to the spec file the line:

%undefine _ld_as_needed

Comment 2 Alfredo Moralejo 2022-02-28 09:50:18 UTC
This issue is totally blocking OpenStack upstream CI on CentOS, may it be possible to get a fix asap?

Comment 3 Matej Mužila 2022-02-28 13:21:40 UTC
(In reply to Alfredo Moralejo from comment #2)
> This issue is totally blocking OpenStack upstream CI on CentOS, may it be
> possible to get a fix asap?

Yes, I'm aleready working on it.

Comment 4 Matej Mužila 2022-02-28 13:49:31 UTC
*** Bug 2059049 has been marked as a duplicate of this bug. ***

Comment 5 Matej Mužila 2022-03-01 14:53:11 UTC
This bug is being solved as part of bug2044859.

*** This bug has been marked as a duplicate of bug 2044859 ***