[Wheel-builders] Error from numpy wheel - any thoughts

Matthew Brett matthew.brett at gmail.com
Mon Mar 28 18:12:12 EDT 2016


On Mon, Mar 28, 2016 at 2:30 PM, Nathaniel Smith <njs at pobox.com> wrote:
> On Mar 28, 2016 14:20, "Matthew Brett" <matthew.brett at gmail.com> wrote:
>>
>> On Mon, Mar 28, 2016 at 1:42 PM, Matthew Brett <matthew.brett at gmail.com>
>> wrote:
>> > I'm installing a manylinux wheel on a Debian sid machine I have.  For
>> > the manylinux wheel, but not a local build, I get the following error
>> > from `nosetests numpy.f2py`:
>> >
>> > ```
>> > ======================================================================
>> > ERROR: test_kind.TestKind.test_all
>> > ----------------------------------------------------------------------
>> > Traceback (most recent call last):
>> >   File
>> > "/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/nose/case.py",
>> > line 381, in setUp
>> >     try_run(self.inst, ('setup', 'setUp'))
>> >   File
>> > "/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/nose/util.py",
>> > line 471, in try_run
>> >     return func()
>> >   File
>> > "/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/f2py/tests/util.py",
>> > line 358, in setUp
>> >     module_name=self.module_name)
>> >   File
>> > "/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/f2py/tests/util.py",
>> > line 78, in wrapper
>> >     memo[key] = func(*a, **kw)
>> >   File
>> > "/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/f2py/tests/util.py",
>> > line 149, in build_module
>> >     __import__(module_name)
>> > ImportError:
>> > /home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/core/../.libs/libgfortran.so.3:
>> > version `GFORTRAN_1.4' not found (required by
>> > /tmp/tmpsFHJXE/_test_ext_module_5405.so)
>> > ```
>> >
>> > Anyone out there with insight as to what's going on?
>>
>> I guess what might be happening, is that the built f2py module should
>> be linking against the system libgfortran, but in fact is finding the
>> shipped gfortran.
>
> I think this diagnosis is correct, but I don't know why it would be
> happening. The newly compiled module should be getting loaded into a fresh
> ELF context and find the system gfortran. We're not adding the .libs dir to
> LD_LIBRARY_PATH, right? Are we somehow adding the .libs dir to the built
> module's rpath?
>
> Some things to try:
> - run with LD_DEBUG=libs
> - check LD_LIBRARY_PATH
> - use readelf on the _test_ex_module.so to see if it has an rpath set

I can't replicate this error in a fresh Python process:

ImportError: /home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/core/../.libs/libgfortran.so.3:
version `GFORTRAN_1.4' not found (required by
/tmp/tmpjqst5B/_test_ext_module_5405.so)

$ cd /tmp/tmpjqst5B
$ python -c 'import _test_ext_module_5405'

No sign of a custom rpath:

$ readelf -d _test_ext_module_5405.so

Dynamic section at offset 0x5d60 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libpython2.7.so.1.0]
 0x0000000000000001 (NEEDED)             Shared library: [libgfortran.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libquadmath.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x17c0
 0x000000000000000d (FINI)               0x41e0
 0x0000000000000019 (INIT_ARRAY)         0x205d40
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x205d48
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x1f0
 0x0000000000000005 (STRTAB)             0x9c8
 0x0000000000000006 (SYMTAB)             0x2a8
 0x000000000000000a (STRSZ)              1328 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x206000
 0x0000000000000002 (PLTRELSZ)           1128 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x1358
 0x0000000000000007 (RELA)               0xfe0
 0x0000000000000008 (RELASZ)             888 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0xf90
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0xef8
 0x000000006ffffff9 (RELACOUNT)          18
 0x0000000000000000 (NULL)               0x0

Stopping in pdb:

$ nosetests numpy.f2py --pdb
..........................................................................................................................................................................................................................................................................................................................................................................>
/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/f2py/tests/util.py(151)build_module()
-> __import__(module_name)
(Pdb) os.environ['LD_LIBRARY_PATH']
*** KeyError: 'LD_LIBRARY_PATH'
(Pdb) module_name
'_test_ext_module_5405'
(Pdb) import _test_ext_module_5405
*** ImportError:
/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/core/../.libs/libgfortran.so.3:
version `GFORTRAN_1.4' not found (required by
/tmp/tmp8KkcW2/_test_ext_module_5405.so)

Running

LD_DEBUG=libs nosetests
/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/f2py/tests/test_kind.py:TestKind.test_all

gives no test error, but does show this:

     18543:    find library=libgfortran.so.3 [0]; searching
     18543:     search
path=/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/core/../.libs
       (RPATH from file
/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/core/multiarray.so)
     18543:      trying
file=/home/mb312/dev_trees/2fd9d9a29e022c297634/manylinux-test/lib/python2.7/site-packages/numpy/core/../.libs/libgfortran.so.3


Matthew


More information about the Wheel-builders mailing list