Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 675542

Summary: dev-python/numpy - ld: /usr/lib64/librefblas.so: undefined reference to `_gfortran_st_write_done@GFORTRAN_7'
Product: Gentoo Linux Reporter: Horea Christian <gentoo>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: RESOLVED FIXED    
Severity: normal CC: frp.bissey, gentoo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=646090
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: 1.14.5 build.log
1.15.4 build.log

Description Horea Christian 2019-01-15 19:33:34 UTC
Created attachment 561346 [details]
1.14.5 build.log

This happens for both =dev-python/numpy-1.14.5 and =dev-python/numpy-1.15.4 and probably other versions as well.

I have checked and both lapack and cblas are installed and selected.
Comment 1 Horea Christian 2019-01-15 19:34:11 UTC
Created attachment 561348 [details]
1.15.4 build.log
Comment 2 Fran├žois Bissey 2019-01-16 09:46:54 UTC
Would you using gcc-8 by any chance?
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe /var/tmp/portage/dev-python/numpy-1.15.4/temp/tmpW2Yg3q/var/tmp/portage/dev-python/numpy-1.15.4/temp/tmpW2Yg3q/source.o -L/usr/lib64 -lrefblas -lrefcblas -o /var/tmp/portage/dev-python/numpy-1.15.4/temp/tmpW2Yg3q/a.out
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libgfortran.so.4, needed by /usr/lib64/librefblas.so, not found (try using -rpath or -rpath-link)

libgfortran.so.4 is provided by gcc-7 but gcc-8 provides libgfortran.so.5 which means that blas and lapack have to be rebuilt.
Comment 3 Horea Christian 2019-01-16 10:30:21 UTC
As you have correctly identified from the log, I do indeed use `x86_64-pc-linux-gnu-8.2.0`. Your suggestion also solved the issue :) thanks!

The only remaining question for me is: why did neither `emerge @preserved-rebuild` nor `revdep-rebuild` pick up on this?
Comment 4 Fran├žois Bissey 2019-01-16 23:59:03 UTC
That particular one is not picked up for a number of reasons. It is a hard case. But I have been fielding that problem for some months.
It started when moving to gcc-7 where libgortran moved from so.3 to so.4. And now with gcc-8 where it moved to so.5.

For a long time gfortran stayed at so.3 so it was not a problem. Part of the issue is FORTRAN itself which is underdefined compared to C or C++. Unlike those there is no "forward" compatibility in the language spec.
Comment 5 Mathy Vanvoorden 2019-07-03 12:03:26 UTC
Can confirm, reinstalling lapack and blas after upgrade to gcc 8 fixed issues with numpy for me.
Comment 6 Benda Xu gentoo-dev 2019-07-15 04:39:38 UTC
Sorry that we did not foresee this during the gfortran transition.  But let's close it as obsolete for now.
Comment 7 Benda Xu gentoo-dev 2019-07-15 04:40:50 UTC
Sorry, it is not obsolete.  There is still potential breakage in the future.
Comment 8 Benda Xu gentoo-dev 2019-07-15 04:41:32 UTC
(In reply to Horea Christian from comment #3)
> As you have correctly identified from the log, I do indeed use
> `x86_64-pc-linux-gnu-8.2.0`. Your suggestion also solved the issue :) thanks!
> 
> The only remaining question for me is: why did neither `emerge
> @preserved-rebuild` nor `revdep-rebuild` pick up on this?

I am having the same question.
Comment 9 Benda Xu gentoo-dev 2020-05-13 00:32:29 UTC
This is finally fixed in bug 646090.