On Tue, Jun 21, 2011 at 3:55 AM, Bruce Southey <bsout...@gmail.com> wrote:

> On Mon, Jun 20, 2011 at 2:43 PM, Ralf Gommers
> <ralf.gomm...@googlemail.com> wrote:
> >
> >
> > On Mon, Jun 20, 2011 at 8:50 PM, Bruce Southey <bsout...@gmail.com>
> wrote:
> >>
> >> I copied the files but that just moves the problem. So that patch is
> >> incorrect.
> >>
> >> I get the same errors on Fedora 15 supplied Python3.2 for numpy 1.6.0
> and
> >> using git from 'https://github.com/rgommers/numpy.git'.  Numpy is
> getting
> >> Fedora supplied Atlas (1.5.1 does not).
> >>
> >> It appears that there is a misunderstanding of the PEP because 'SO' and
> >> 'SOABI' do exactly what the PEP says on my systems:
> >
> > It doesn't on OS X. But that's not even the issue. As I explained before,
> > the issue is that get_config_var('SO') is used to determine the extension
> of
> > system libraries (such as liblapack.so) and python-related ones (such as
> > multiarray.cpython-32m.so).  And the current functions don't do
> mindreading.
> >>
> >> >>> from distutils import sysconfig sysconfig.get_config_var('SO')
> >> '.cpython-32m.so'
> >> >>> sysconfig.get_config_var('SOABI')
> >> 'cpython-32m'
> >>
> >> Consequently, the name, 'multiarray.pyd', created within numpy is
> invalid.
> >
> > I removed the line in ctypeslib that was trying this, so I think you are
> not
> > testing my patch.
> >
> > Ralf
> >
> >>
> >> Looking the code, I see this line which makes no sense given that the
> >> second part is true under Linux:
> >>
> >> if (not is_python_ext) and 'SOABI' in
> >> distutils.sysconfig.get_config_vars():
> >>
> >> So I think the 'get_shared_lib_extension' function is wrong and probably
> >> unneeded.
> >>
> >>
> >> Bruce
> >>
>
> Just to show that this is the new version, I added two print
> statements in the 'get_shared_lib_extension' function:
> >>> from numpy.distutils.misc_util import get_shared_lib_extension
> >>> get_shared_lib_extension(True)
> first so_ext .cpython-32mu.so
> returned so_ext .cpython-32mu.so
> '.cpython-32mu.so'
> >>> get_shared_lib_extension(False)
> first so_ext .cpython-32mu.so
> returned so_ext .so
> '.so'
>

This all looks correct. Before you were saying you were still getting
'multiarray.pyd', now your error says 'multiarray.so'. So now you are
testing the right thing. Test test_basic2() in test_ctypeslib was fixed, but
I forgot to fix it in two other places. I updated both my branches on
github, please try again.

>
> The reason for the same location is obvious because all the patch does
> is move  the code to get the extension into that function. So the
> 'get_shared_lib_extension' function returns the extension '.so' to the
> load_library function. However that name is wrong under Linux as it
> has to be 'multiarray.cpython-32mu.so' and hence the error in the same
> location. I did come across this thread
> 'http://bugs.python.org/issue10262' which indicates why Linux is
> different by default.
>
> So what is the actual name of the multiarray shared library with the Mac?
> If it is ' 'multiarray.so' then the correct name is "libname +
> sysconfig.get_config_var('SO')" as I previously indicated.
>
> It is, and yes that's correct. Orthogonal to the actual issue though.

Ralf



>
> Bruce
>
>
>
>
> $ python3
> Python 3.2 (r32:88445, Feb 21 2011, 21:11:06)
> [GCC 4.6.0 20110212 (Red Hat 4.6.0-0.7)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import numpy as np
> >>> np.test()
> Running unit tests for numpy
> NumPy version 2.0.0.dev-Unknown
> NumPy is installed in /usr/lib64/python3.2/site-packages/numpy
> Python version 3.2 (r32:88445, Feb 21 2011, 21:11:06) [GCC 4.6.0
> 20110212 (Red Hat 4.6.0-0.7)]
> nose version 1.0.0
> first so_ext .cpython-32mu.so
> returned so_ext .so
>
> ...F.......S......F.....E..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K............................................................................................................................................................................................K..................................................................................................K......................K...........................................................................................first
> so_ext .cpython-32mu.so
> returned so_ext .so
>
> ...............S..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................../usr/lib64/python3.2/site-packages/numpy/lib/format.py:575:
> ResourceWarning: unclosed file <_io.BufferedReader
> name='/tmp/tmpw661ug'>
>  mode=mode, offset=offset)
>
> .........................................................................................................................................................................................................................................................................................................................................................................................................................................................................../usr/lib64/python3.2/subprocess.py:460:
> ResourceWarning: unclosed file <_io.BufferedReader name=3>
>  return Popen(*popenargs, **kwargs).wait()
> /usr/lib64/python3.2/subprocess.py:460: ResourceWarning: unclosed file
> <_io.BufferedReader name=8>
>  return Popen(*popenargs, **kwargs).wait()
>
> ..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................first
> so_ext .cpython-32mu.so
> returned so_ext .so
> E........
> ======================================================================
> ERROR: test_datetime_divide (test_datetime.TestDateTime)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/usr/lib64/python3.2/site-packages/numpy/core/tests/test_datetime.py",
> line 762, in test_datetime_divide
>    assert_equal(tda / tdb, 6.0 / 9.0)
> TypeError: internal error: could not find appropriate datetime inner
> loop in true_divide ufunc
>
> ======================================================================
> ERROR: Failure: OSError
> (/usr/lib64/python3.2/site-packages/numpy/core/multiarray.so: cannot
> open shared object file: No such file or directory)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/usr/lib/python3.2/site-packages/nose-1.0.0-py3.2.egg/nose/failure.py",
> line 37, in runTest
>    raise self.exc_class(self.exc_val).with_traceback(self.tb)
>  File
> "/usr/lib/python3.2/site-packages/nose-1.0.0-py3.2.egg/nose/loader.py",
> line 390, in loadTestsFromName
>    addr.filename, addr.module)
>  File
> "/usr/lib/python3.2/site-packages/nose-1.0.0-py3.2.egg/nose/importer.py",
> line 39, in importFromPath
>    return self.importFromDir(dir_path, fqname)
>   File
> "/usr/lib/python3.2/site-packages/nose-1.0.0-py3.2.egg/nose/importer.py",
> line 86, in importFromDir
>    mod = load_module(part_fqname, fh, filename, desc)
>   File "/usr/lib64/python3.2/site-packages/numpy/tests/test_ctypeslib.py",
> line 9, in <module>
>    cdll = load_library('multiarray', np.core.multiarray.__file__)
>   File "/usr/lib64/python3.2/site-packages/numpy/ctypeslib.py", line
> 124, in load_library
>    raise exc
>  File "/usr/lib64/python3.2/site-packages/numpy/ctypeslib.py", line
> 121, in load_library
>    return ctypes.cdll[libpath]
>  File "/usr/lib64/python3.2/ctypes/__init__.py", line 415, in __getitem__
>    return getattr(self, name)
>  File "/usr/lib64/python3.2/ctypes/__init__.py", line 410, in __getattr__
>    dll = self._dlltype(name)
>  File "/usr/lib64/python3.2/ctypes/__init__.py", line 340, in __init__
>     self._handle = _dlopen(self._name, mode)
> OSError: /usr/lib64/python3.2/site-packages/numpy/core/multiarray.so:
> cannot open shared object file: No such file or directory
>
> ======================================================================
> FAIL: Test custom format function for each element in array.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/usr/lib64/python3.2/site-packages/numpy/core/tests/test_arrayprint.py",
> line 86, in test_format_function
>    "[0x0L 0x1L 0x2L]")
>   File "/usr/lib64/python3.2/site-packages/numpy/testing/utils.py",
> line 313, in assert_equal
>    raise AssertionError(msg)
> AssertionError:
> Items are not equal:
>  ACTUAL: '[0x0 0x1 0x2]'
>  DESIRED: '[0x0L 0x1L 0x2L]'
>
> ======================================================================
> FAIL: test_datetime_as_string (test_datetime.TestDateTime)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/usr/lib64/python3.2/site-packages/numpy/core/tests/test_datetime.py",
> line 1001, in test_datetime_as_string
>    '1959')
>  File "/usr/lib64/python3.2/site-packages/numpy/testing/utils.py",
> line 313, in assert_equal
>    raise AssertionError(msg)
> AssertionError:
> Items are not equal:
>  ACTUAL: b'1959'
>  DESIRED: '1959'
>
> ----------------------------------------------------------------------
> Ran 3215 tests in 45.744s
>
> FAILED (KNOWNFAIL=4, SKIP=2, errors=2, failures=2)
> <nose.result.TextTestResult run=3215 errors=2 failures=2>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to