test_dl.TestDL test failure

Issue #28 resolved
Anatol Anatol created an issue

I am trying mpi4py 2.0.0 package for Linux Arch and got test_dl.TestDL test failure

running test
[0@anatol] Python 2.7 (/usr/bin/python2)
[0@anatol] MPI 3.0 (Open MPI 1.10.0)
[0@anatol] mpi4py 2.0.0 (build/lib.linux-x86_64-2.7/mpi4py)
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................F....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
======================================================================
FAIL: testDL1 (test_dl.TestDL)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_dl.py", line 18, in testDL1
    self.assertTrue(handle != 0)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 1025 tests in 5.293s

FAILED (failures=1)
error: test

Comments (8)

  1. Lisandro Dalcin

    This test assumes you can dlopen() the shared library libm.so. I guess you have not installed the glibc development package, or perhaps your libm is not a shared library. Could you try to edit the test file and use libm.so.6 instead?

  2. Thomas Spura

    Recently, we hit a bug with libm.so within scipy that might be related to this. Using libm.so.6 should also fix this issue in that case.

  3. Lisandro Dalcin

    Here you have is a possible fix:

    diff --git a/test/test_dl.py b/test/test_dl.py
    index a3211a3..53b9f36 100644
    --- a/test/test_dl.py
    +++ b/test/test_dl.py
    @@ -15,6 +15,9 @@ class TestDL(unittest.TestCase):
                 libm = 'libm.so'
    
             handle = dl.dlopen(libm, dl.RTLD_LOCAL|dl.RTLD_LAZY)
    +        if handle == 0 and sys.platform.startswith('linux'):
    +            self.assertTrue(dl.dlerror() is not None)
    +            handle = dl.dlopen('libm.so.6', dl.RTLD_LOCAL|dl.RTLD_LAZY)
             self.assertTrue(handle != 0)
             self.assertTrue(dl.dlerror() is None)
    
  4. Anatol Anatol reporter

    FYI content of my libm.so is

    [anatol@arch ~]$ cat /usr/lib/libm.so
    /* GNU ld script
    */
    OUTPUT_FORMAT(elf64-x86-64)
    GROUP ( /usr/lib/libm.so.6  AS_NEEDED ( /usr/lib/libmvec.so.1 ) )
    

    And libm.so.6 is a pointer to the binary

    [anatol@arch ~]$ ls -l /usr/lib/libm.so.6 
    lrwxrwxrwx 1 root root 12 Sep  1 10:09 /usr/lib/libm.so.6 -> libm-2.22.so
    [anatol@arch ~]$ ls -l /usr/lib/libm-2.22.so 
    -rwxr-xr-x 1 root root 1038688 Sep  1 10:09 /usr/lib/libm-2.22.so
    
  5. Log in to comment