tags 661287 + patch
thanks

for the record, attached the patches ubuntu applied to fix the issue.
I tested them on armel, armhf, sparc and mipsel, the rdep pandas also
works with it.
For hurd and kfreebsd need additional fixes which are available in the
debian package git.
The patch to skip the blosc tests needs some adaption for arches != arm
and please also read the header for issues with it.
diff -Nru pytables-2.3.1/debian/control pytables-2.3.1/debian/control
--- pytables-2.3.1/debian/control       2012-01-28 12:50:35.000000000 +0100
+++ pytables-2.3.1/debian/control       2012-03-03 12:26:47.000000000 +0100
@@ -1,13 +1,14 @@
 Source: pytables
 Section: python
 Priority: optional
-Maintainer: Debian Science Maintainers 
<debian-science-maintain...@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Science Maintainers 
<debian-science-maintain...@lists.alioth.debian.org>
 Uploaders: Antonio Valentino <antonio.valent...@tiscali.it>, Yaroslav 
Halchenko <deb...@onerussian.com>
 DM-Upload-Allowed: yes
 Homepage: http://www.pytables.org
 Standards-Version: 3.9.2
 X-Python-Version: >= 2.4
-Build-Depends: debhelper (>= 8.1.0), libhdf5-dev (>= 1.6.5),
+Build-Depends: debhelper (>= 8.1.0), libhdf5-serial-dev (>= 1.6.5),
                python-all-dev (>= 2.6.6-3~), python-numpy (>= 1:1.4.1-4~),
                python-numexpr (>= 1.4.1), cython (>= 0.13),
                zlib1g-dev, liblzo2-dev, libbz2-dev, python-sphinx (>= 
1.0.7+dfsg),
diff -Nru pytables-2.3.1/debian/patches/disable_blosc.patch 
pytables-2.3.1/debian/patches/disable_blosc.patch
--- pytables-2.3.1/debian/patches/disable_blosc.patch   1970-01-01 
01:00:00.000000000 +0100
+++ pytables-2.3.1/debian/patches/disable_blosc.patch   2012-03-03 
12:26:47.000000000 +0100
@@ -0,0 +1,65 @@
+Description: disable blosc on arm
+ blosc compression is not functional due to the reliance on unaligned
+ memory access. This patch replaces all blosc write functionality with
+ zlib (default fallback) and disables a test reading blosc compressed data.
+ One could also disable reading by removing it from all_complibs in
+ tables/filters.py but that would require fixing up all tests to expect
+ exceptions.
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661286
+Bug: https://github.com/FrancescAlted/blosc/issues/3
+Author: Julian Taylor <jtay...@ubuntu.com>
+--- a/tables/utilsExtension.pyx
++++ b/tables/utilsExtension.pyx
+@@ -14,6 +14,7 @@
+ 
+ import sys
+ import warnings
++import platform
+ 
+ try:
+   import zlib
+@@ -376,7 +377,8 @@
+       (bzip2_version_string, bzip2_version_date) = bzip2_version
+       return (bzip2_version, bzip2_version_string, bzip2_version_date)
+   elif strcmp(name, "blosc") == 0:
+-    return (blosc_version, blosc_version_string, blosc_version_date)
++    if "arm" not in platform.machine().lower():
++      return (blosc_version, blosc_version_string, blosc_version_date)
+   else:
+     raise ValueError("""\
+ asked version of unsupported library ``%s``; \
+--- a/tables/tests/test_all.py
++++ b/tables/tests/test_all.py
+@@ -14,6 +14,7 @@
+ from tables.req_versions import *
+ from tables.tests import common
+ from tables.utils import detectNumberOfCores
++import platform
+ 
+ 
+ 
+@@ -133,9 +134,10 @@
+     if tinfo is not None:
+         print "BZIP2 version:     %s (%s)" % (tinfo[1], tinfo[2])
+     tinfo = tables.whichLibVersion("blosc")
+-    blosc_date = tinfo[2].split()[1]
+-    if tinfo is not None:
+-        print "Blosc version:     %s (%s)" % (tinfo[1], blosc_date)
++    if "arm" not in platform.machine().lower():
++      blosc_date = tinfo[2].split()[1]
++      if tinfo is not None:
++          print "Blosc version:     %s (%s)" % (tinfo[1], blosc_date)
+     try:
+         from Cython.Compiler.Main import Version as Cython_Version
+         print 'Cython version:    %s' % Cython_Version.version
+--- a/tables/tests/test_basics.py
++++ b/tables/tests/test_basics.py
+@@ -2338,7 +2338,7 @@
+         theSuite.addTest(unittest.makeSuite(PythonAttrsTestCase))
+         theSuite.addTest(unittest.makeSuite(StateTestCase))
+         theSuite.addTest(unittest.makeSuite(FlavorTestCase))
+-        theSuite.addTest(unittest.makeSuite(BloscBigEndian))
++        #theSuite.addTest(unittest.makeSuite(BloscBigEndian))
+         theSuite.addTest(unittest.makeSuite(BloscSubprocess))
+ 
+     return theSuite
diff -Nru pytables-2.3.1/debian/patches/fix_alignment.patch 
pytables-2.3.1/debian/patches/fix_alignment.patch
--- pytables-2.3.1/debian/patches/fix_alignment.patch   1970-01-01 
01:00:00.000000000 +0100
+++ pytables-2.3.1/debian/patches/fix_alignment.patch   2012-03-03 
12:26:47.000000000 +0100
@@ -0,0 +1,32 @@
+Description: remove unaligned memory accesses
+Bug: https://github.com/PyTables/PyTables/issues/134
+Author: Julian Taylor <jtay...@ubuntu.com
+--- a/src/typeconv.c
++++ b/src/typeconv.c
+@@ -66,18 +66,21 @@
+ 
+   for (record = 0;  record < nrecords;  record++) {
+     for (element = 0;  element < nelements;  element++) {
++      double fb;
++      memcpy(&fb, fieldbase, sizeof(fb));
+       if (sense == 0) {
+       /* Convert from float64 to timeval32. */
+-      tv.i64 = (((PY_LONG_LONG)(*fieldbase) << 32)
+-                | (lround((*fieldbase - (int)(*fieldbase)) * 1e+6)
++        tv.i64 = (((PY_LONG_LONG)(fb) << 32)
++                | (lround((fb - (int)(fb)) * 1e+6)
+                    & 0x0ffffffff));
+-      *fieldbase = tv.f64;
++        fb = tv.f64;
+       } else {
+       /* Convert from timeval32 to float64. */
+-      tv.f64 = *fieldbase;
++        tv.f64 = fb;
+       /* the next computation is 64 bit-platforms aware */
+-      *fieldbase = 1e-6 * (int)tv.i64 + (tv.i64 >> 32);
++        fb = 1e-6 * (int)tv.i64 + (tv.i64 >> 32);
+       }
++      memcpy(fieldbase, &fb, sizeof(fb));
+       fieldbase++;
+     }
+ 
diff -Nru pytables-2.3.1/debian/patches/fix_library_detection.patch 
pytables-2.3.1/debian/patches/fix_library_detection.patch
--- pytables-2.3.1/debian/patches/fix_library_detection.patch   1970-01-01 
01:00:00.000000000 +0100
+++ pytables-2.3.1/debian/patches/fix_library_detection.patch   2012-03-03 
12:26:47.000000000 +0100
@@ -0,0 +1,118 @@
+From b26297256ed94ee34b65429520fb9adf1686fc04 Mon Sep 17 00:00:00 2001
+From: Antonio Valentino <antonio.valent...@tiscali.it>
+Date: Sun, 19 Feb 2012 18:26:25 +0100
+Subject: Fix the detection of multiarched libraries
+
+Bug: https://github.com/PyTables/PyTables/issues/124
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657789
+Forwarded: yes
+
+---
+ setup.py          |   37 ++++++++++++++++++++++++++++---------
+ 1 file changed, 28 insertions(+), 9 deletions(-)
+
+--- a/setup.py
++++ b/setup.py
+@@ -21,6 +21,7 @@
+ from distutils.core     import Extension
+ from distutils.dep_util import newer
+ from distutils.util     import convert_path
++from distutils.ccompiler import new_compiler
+ 
+ # The minimum required versions
+ # (keep these in sync with tables.req_versions and user's guide and README)
+@@ -241,12 +242,14 @@
+ 
+     _component_dirs = ['include', 'lib']
+ 
+-    def __init__(self, name, tag, header_name, library_name):
++    def __init__(self, name, tag, header_name, library_name,
++                 target_function=None):
+         self.name = name
+         self.tag = tag
+         self.header_name = header_name
+         self.library_name = library_name
+         self.runtime_name = library_name
++        self.target_function = target_function
+ 
+ class WindowsPackage(Package):
+     _library_prefixes = ['']
+@@ -257,12 +260,14 @@
+     # lookup in '.' seems necessary for LZO2
+     _component_dirs = ['include', 'lib', 'dll', '.']
+ 
+-    def __init__(self, name, tag, header_name, library_name, runtime_name):
++    def __init__(self, name, tag, header_name, library_name, runtime_name,
++                 target_function=None):
+         self.name = name
+         self.tag = tag
+         self.header_name = header_name
+         self.library_name = library_name
+         self.runtime_name = runtime_name
++        self.target_function = target_function
+ 
+     def find_runtime_path(self, locations=default_runtime_dirs):
+         # An explicit path can not be provided for runtime libraries.
+@@ -319,10 +324,14 @@
+     if '--debug' in sys.argv:
+         _platdep['HDF5'] = ['hdf5ddll', 'hdf5ddll']
+ 
+-hdf5_package = _Package("HDF5", 'HDF5', 'H5public', *_platdep['HDF5'])
+-lzo2_package = _Package("LZO 2", 'LZO2', _cp('lzo/lzo1x'), *_platdep['LZO2'])
+-lzo1_package = _Package("LZO 1", 'LZO', 'lzo1x', *_platdep['LZO'])
+-bzip2_package = _Package("bzip2", 'BZ2', 'bzlib', *_platdep['BZ2'])
++hdf5_package = _Package("HDF5", 'HDF5', 'H5public', *_platdep['HDF5'],
++                        target_function='H5close')
++lzo2_package = _Package("LZO 2", 'LZO2', _cp('lzo/lzo1x'), *_platdep['LZO2'],
++                        target_function='lzo_version_date')
++lzo1_package = _Package("LZO 1", 'LZO', 'lzo1x', *_platdep['LZO'],
++                        target_function='lzo_version_date')
++bzip2_package = _Package("bzip2", 'BZ2', 'bzlib', *_platdep['BZ2'],
++                         target_function='BZ2_bzlibVersion')
+ 
+ 
+ #-----------------------------------------------------------------
+@@ -383,6 +392,7 @@
+ 
+ # Try to locate the compulsory and optional libraries.
+ lzo2_enabled = False
++c = new_compiler()
+ for (package, location) in [
+     (hdf5_package, HDF5_DIR),
+     (lzo2_package, LZO_DIR),
+@@ -397,6 +407,11 @@
+ 
+     (hdrdir, libdir, rundir) = package.find_directories(location)
+ 
++    # check if the library is in the standard compiler paths
++    if not libdir:
++        libdir = c.has_function(package.target_function,
++                                libraries=(package.library_name,))
++
+     if not (hdrdir and libdir):
+         if package.tag in ['HDF5']:  # these are compulsory!
+             pname, ptag = package.name, package.tag
+@@ -411,8 +426,12 @@
+                 "disabling support for it."  % package.name)
+         continue  # look for the next library
+ 
+-    print ( "* Found %s headers at ``%s``, library at ``%s``."
+-            % (package.name, hdrdir, libdir) )
++    if libdir in ("", True):
++        print ( "* Found %s headers at ``%s``, the library is located in the "
++                "standard system search dirs." % (package.name, hdrdir) )
++    else:
++        print ( "* Found %s headers at ``%s``, library at ``%s``."
++                % (package.name, hdrdir, libdir) )
+ 
+     if package.tag in ['HDF5']:
+         hdf5_header = os.path.join(hdrdir, "H5public.h")
+@@ -423,7 +442,7 @@
+ 
+     if hdrdir not in default_header_dirs:
+         inc_dirs.append(hdrdir)  # save header directory if needed
+-    if libdir not in default_library_dirs:
++    if libdir not in default_library_dirs and libdir not in ("", True):
+         # save library directory if needed
+         if os.name == "nt":
+             # Important to quote the libdir for Windows (Vista) systems
diff -Nru pytables-2.3.1/debian/patches/series 
pytables-2.3.1/debian/patches/series
--- pytables-2.3.1/debian/patches/series        1970-01-01 01:00:00.000000000 
+0100
+++ pytables-2.3.1/debian/patches/series        2012-03-03 12:26:47.000000000 
+0100
@@ -0,0 +1,3 @@
+fix_library_detection.patch
+disable_blosc.patch
+fix_alignment.patch
diff -Nru pytables-2.3.1/debian/rules pytables-2.3.1/debian/rules
--- pytables-2.3.1/debian/rules 2012-01-28 12:50:35.000000000 +0100
+++ pytables-2.3.1/debian/rules 2012-03-03 12:26:47.000000000 +0100
@@ -43,7 +43,7 @@
        set -e; \
        for v in $(PYVERS); do \
                cd "$(CURDIR)/debian/tmp/usr/lib/python$$v/dist-packages/"; \
-               env PYTHONPATH=. python$$v tables/tests/test_all.py; \
+               env PYTHONPATH=. python$$v tables/tests/test_all.py -vvv; \
        done
 endif
 

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to