Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
numpy seems to want versions 3 and 4 of fortran
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
justin_brody
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 283

PostPosted: Sun Jun 24, 2018 8:52 am    Post subject: numpy seems to want versions 3 and 4 of fortran Reply with quote

Hello,
I am unable to import numpy because it cannot find fortran 3:
Code:

$ python -c "import numpy as np"   Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.5/site-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/usr/lib64/python3.5/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib64/python3.5/site-packages/numpy/lib/__init__.py", line 19, in <module>
    from .polynomial import *
  File "/usr/lib64/python3.5/site-packages/numpy/lib/polynomial.py", line 20, in <module>
    from numpy.linalg import eigvals, lstsq, inv
  File "/usr/lib64/python3.5/site-packages/numpy/linalg/__init__.py", line 51, in <module>
    from .linalg import *
  File "/usr/lib64/python3.5/site-packages/numpy/linalg/linalg.py", line 30, in <module>
    from numpy.linalg import lapack_lite, _umath_linalg
ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory
I do have libgfortran.so.4 installed on my system and numpy seems to find it:
Code:

$ ldd /usr/lib64/python2.7/site-packages/numpy/linalg/lapack_lite.so
        linux-vdso.so.1 (0x00007ffc07cf7000)
        liblapack.so.0 => /usr/lib64/liblapack.so.0 (0x00007fdf59e17000)
        libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00007fdf59a36000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fdf59674000)
        libblas.so.0 => /opt/openblas/lib/libblas.so.0 (0x00007fdf586cc000)
        libgfortran.so.4 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgfortran.so.4 (0x00007fdf582f1000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fdf57f9f000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgcc_s.so.1 (0x00007fdf57d88000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdf57b68000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fdf57964000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007fdf57761000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdf5a804000)
        libgfortran.so.3 => not found
        libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgomp.so.1 (0x00007fdf57533000)
        libquadmath.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libquadmath.so.0 (0x00007fdf572f3000)


Any ideas? I've re-emerged blas-reference, lapack-reference, cblas-reference, and numpy but am still getting this error....
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30909
Location: here

PostPosted: Sun Jun 24, 2018 9:48 am    Post subject: Reply with quote

You are sure to have compiled the right packages, because I tried in my system enabling lapack use flag on numpy and all linked correctly
Code:
$ ldd /usr/lib64/python2.7/site-packages/numpy/linalg/lapack_lite.so
        linux-vdso.so.1 (0x00007ffc993db000)
        liblapack.so.0 => /usr/lib64/liblapack.so.0 (0x00007fef14a2e000)
        libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00007fef1464d000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fef1428b000)
        libblas.so.0 => /usr/lib64/blas/reference/libblas.so.0 (0x00007fef14035000)
        libgfortran.so.4 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgfortran.so.4 (0x00007fef13c5a000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fef13917000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgcc_s.so.1 (0x00007fef13700000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fef134e0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fef132dc000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007fef130d9000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fef1541b000)
        libquadmath.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libquadmath.so.0 (0x00007fef12e99000)

Below packages compiled with lapack use flag
Code:
[ebuild  N     ] virtual/cblas-1.0::gentoo  0 KiB
[ebuild  N     ] app-eselect/eselect-lapack-0.1::gentoo  0 KiB
[ebuild  N     ] app-eselect/eselect-blas-0.1::gentoo  0 KiB
[ebuild  N     ] sci-libs/blas-reference-20070226-r4::gentoo  USE="-doc" 5,208 KiB
[ebuild  N     ] virtual/blas-1.0::gentoo  0 KiB
[ebuild  N     ] sci-libs/lapack-reference-3.2.1-r4::gentoo  USE="-doc" 4,694 KiB
[ebuild  N     ] virtual/lapack-3.1::gentoo  0 KiB
[ebuild   R    ] dev-python/numpy-1.10.4::gentoo  USE="lapack* -doc {-test}" PYTHON_TARGETS="python2_7 python3_6 -python3_4 -python3_5" 0 KiB

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
justin_brody
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 283

PostPosted: Sun Jun 24, 2018 9:52 am    Post subject: numpy seems to want versions 3 and 4 of fortran [solvedISH] Reply with quote

Thanks for this fedeliallalinea. It seemed to be lapack that was linking to gfortran 3. I couldn't get this to change by re-emerging, but I ended up bringing in openblas from the science overlay and after some mucking about all seems well. I unfortunatley can't give any systemic solution because I was really just trying a bunch of things but currently all seems well.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum