Compare commits
30 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
932fa34f97 | ||
|
|
78da716688 | ||
|
|
e085788a2a | ||
|
|
a8696ba24f | ||
|
|
3896f3a49a | ||
|
|
7cb38b4c62 | ||
|
|
209b2f0f85 | ||
|
|
a08a5e223d | ||
|
|
3ff014b945 | ||
|
|
caafb063cb | ||
|
|
95112fa955 | ||
|
|
e8d8e130cb | ||
|
|
cc348ddb01 | ||
|
|
5ec9720778 | ||
|
|
845a97db6f | ||
|
|
1114febfbe | ||
|
|
f3307e6f50 | ||
|
|
3063863af9 | ||
|
|
ac3ba0bde8 | ||
|
|
f4947a3ef8 | ||
|
|
638a8d793a | ||
|
|
916486b508 | ||
|
|
c21ce9a665 | ||
|
|
c0cb6d7ec6 | ||
|
|
73359c1b3c | ||
|
|
4735f357dd | ||
|
|
a9b3f95abf | ||
|
|
730af7f737 | ||
|
|
d983b20cf6 | ||
|
|
59e03b5fbb |
10 changed files with 530 additions and 389 deletions
|
|
@ -1,69 +0,0 @@
|
|||
From b92e5f1264fb53bbaa975c15682cb2293a16508b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Fri, 12 Jul 2019 18:40:47 +0200
|
||||
Subject: [PATCH 1/2] blosc_extenion: constify char pointers for Py_BuildValue
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This fixes warnings from the compiler:
|
||||
|
||||
blosc/blosc_extension.c: In function ‘PyBlosc_compressor_list’:
|
||||
blosc/blosc_extension.c:104:8: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|
||||
104 | list = blosc_list_compressors();
|
||||
| ^
|
||||
blosc/blosc_extension.c: In function ‘PyBlosc_code_to_name’:
|
||||
blosc/blosc_extension.c:123:40: warning: passing argument 2 of ‘blosc_compcode_to_compname’ from incompatible pointer type [-Wincompatible-pointer-types]
|
||||
123 | if (blosc_compcode_to_compname(code, &name) < 0)
|
||||
| ^~~~~
|
||||
| |
|
||||
| char **
|
||||
In file included from blosc/blosc_extension.c:13:
|
||||
/usr/include/blosc.h:389:72: note: expected ‘const char **’ but argument is of type ‘char **’
|
||||
389 | BLOSC_EXPORT int blosc_compcode_to_compname(int compcode, const char **compname);
|
||||
| ~~~~~~~~~~~~~^~~~~~~~
|
||||
blosc/blosc_extension.c: In function ‘PyBlosc_get_clib’:
|
||||
blosc/blosc_extension.c:345:8: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|
||||
345 | clib = blosc_cbuffer_complib(input);
|
||||
| ^
|
||||
|
||||
https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue
|
||||
> When memory buffers are passed as parameters to supply data to build
|
||||
> objects, as for the s and s# formats, the required data is
|
||||
> copied. Buffers provided by the caller are never referenced by the
|
||||
> objects created by Py_BuildValue().
|
||||
---
|
||||
blosc/blosc_extension.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/blosc/blosc_extension.c b/blosc/blosc_extension.c
|
||||
index 870581a217..237f2e46a7 100644
|
||||
--- a/blosc/blosc_extension.c
|
||||
+++ b/blosc/blosc_extension.c
|
||||
@@ -99,7 +99,7 @@ PyDoc_STRVAR(compressor_list__doc__,
|
||||
static PyObject *
|
||||
PyBlosc_compressor_list(PyObject *self)
|
||||
{
|
||||
- char *list;
|
||||
+ const char *list;
|
||||
|
||||
list = blosc_list_compressors();
|
||||
|
||||
@@ -115,7 +115,7 @@ static PyObject *
|
||||
PyBlosc_code_to_name(PyObject *self, PyObject *args)
|
||||
{
|
||||
int code;
|
||||
- char *name;
|
||||
+ const char *name;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:code_to_name", &code))
|
||||
return NULL;
|
||||
@@ -341,7 +341,7 @@ PyBlosc_get_clib(PyObject *self, PyObject *args)
|
||||
{
|
||||
void *input;
|
||||
size_t cbytes;
|
||||
- char *clib;
|
||||
+ const char *clib;
|
||||
|
||||
/* require Python string object, typesize, clevel and shuffle agrs */
|
||||
if (!PyArg_ParseTuple(args, "s#:get_clib", &input, &cbytes))
|
||||
30
0001-docs-update-example-for-newer-numpy.patch
Normal file
30
0001-docs-update-example-for-newer-numpy.patch
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
From ed3998803650bec0666c3ca458df76fcd9293417 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Fri, 31 Oct 2025 12:33:57 +0100
|
||||
Subject: [PATCH] docs: update example for newer numpy
|
||||
|
||||
File ".../usr/lib64/python3.14/site-packages/blosc/toplevel.py", line 515, in blosc.toplevel.compress_ptr
|
||||
Failed example:
|
||||
np_ans = numpy.fromstring(d, dtype=np_array.dtype)
|
||||
Exception raised:
|
||||
Traceback (most recent call last):
|
||||
File "<doctest blosc.toplevel.compress_ptr[5]>", line 1, in <module>
|
||||
np_ans = numpy.fromstring(d, dtype=np_array.dtype)
|
||||
ValueError: The binary mode of fromstring is removed, use frombuffer instead
|
||||
---
|
||||
blosc/toplevel.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blosc/toplevel.py b/blosc/toplevel.py
|
||||
index 4d2d4139af..3ef2327618 100644
|
||||
--- a/blosc/toplevel.py
|
||||
+++ b/blosc/toplevel.py
|
||||
@@ -513,7 +513,7 @@ def compress_ptr(address, items, typesize=8, clevel=9, shuffle=blosc.SHUFFLE,
|
||||
>>> c = blosc.compress_ptr(np_array.__array_interface__['data'][0], \
|
||||
items, np_array.dtype.itemsize)
|
||||
>>> d = blosc.decompress(c)
|
||||
- >>> np_ans = numpy.fromstring(d, dtype=np_array.dtype)
|
||||
+ >>> np_ans = numpy.frombuffer(d, dtype=np_array.dtype)
|
||||
>>> bool((np_array == np_ans).all())
|
||||
True
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
From b4bac67a4ad842c76e4ec10cbee8dac01abcfad0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Fri, 12 Jul 2019 18:46:44 +0200
|
||||
Subject: [PATCH 2/2] setup.py: unbreak build on architectures which don't have
|
||||
cpu flags
|
||||
|
||||
ppc64le and s390x would fail with:
|
||||
BUILDSTDERR: Traceback (most recent call last):
|
||||
BUILDSTDERR: File "setup.py", line 241, in <module>
|
||||
BUILDSTDERR: if 'DISABLE_BLOSC_SSE2' not in os.environ and (cpu_info != None) and ('sse2' in cpu_info['flags']):
|
||||
BUILDSTDERR: KeyError: 'flags'
|
||||
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.xbprqV (%install)
|
||||
---
|
||||
setup.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 1d8ebe86eb..468b970588 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -238,7 +238,7 @@ if __name__ == '__main__':
|
||||
|
||||
# Guess SSE2 or AVX2 capabilities
|
||||
# SSE2
|
||||
- if 'DISABLE_BLOSC_SSE2' not in os.environ and (cpu_info != None) and ('sse2' in cpu_info['flags']):
|
||||
+ if 'DISABLE_BLOSC_SSE2' not in os.environ and cpu_info != None and 'sse2' in cpu_info.get('flags', {}):
|
||||
print('SSE2 detected')
|
||||
CFLAGS.append('-DSHUFFLE_SSE2_ENABLED')
|
||||
sources += [f for f in glob('c-blosc/blosc/*.c') if 'sse2' in f]
|
||||
@@ -247,7 +247,7 @@ if __name__ == '__main__':
|
||||
elif os.name == 'nt':
|
||||
def_macros += [('__SSE2__', 1)]
|
||||
# AVX2
|
||||
- if 'DISABLE_BLOSC_AVX2' not in os.environ and (cpu_info != None) and ('avx2' in cpu_info['flags']):
|
||||
+ if 'DISABLE_BLOSC_AVX2' not in os.environ and cpu_info != None and 'sse2' in cpu_info.get('flags', {}):
|
||||
if os.name == 'posix':
|
||||
print("AVX2 detected")
|
||||
avx2_defs = {
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
From 8c8cf1a2a09ba8b6b02be5a69bb8cbf5ff2a4838 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Fri, 12 Jul 2019 18:54:36 +0200
|
||||
Subject: [PATCH] setup.py: catch import error for cpuinfo
|
||||
|
||||
BUILDSTDERR: Traceback (most recent call last):
|
||||
BUILDSTDERR: File "setup.py", line 112, in <module>
|
||||
BUILDSTDERR: import cpuinfo
|
||||
BUILDSTDERR: File "/usr/lib/python3.7/site-packages/cpuinfo/__init__.py", line 7, in <module>
|
||||
BUILDSTDERR: from cpuinfo.cpuinfo import *
|
||||
BUILDSTDERR: File "/usr/lib/python3.7/site-packages/cpuinfo/cpuinfo.py", line 2256, in <module>
|
||||
BUILDSTDERR: _check_arch()
|
||||
BUILDSTDERR: File "/usr/lib/python3.7/site-packages/cpuinfo/cpuinfo.py", line 231, in _check_arch
|
||||
BUILDSTDERR: raise Exception("py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.")
|
||||
BUILDSTDERR: Exception: py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.
|
||||
---
|
||||
setup.py | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 468b970588..2508a94fbe 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -109,8 +109,12 @@ if __name__ == '__main__':
|
||||
with io.open('README.rst', encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
- import cpuinfo
|
||||
- cpu_info = cpuinfo.get_cpu_info()
|
||||
+ try:
|
||||
+ import cpuinfo
|
||||
+ cpu_info = cpuinfo.get_cpu_info()
|
||||
+ except Exception:
|
||||
+ # newer cpuinfo versions fail to import on unsupported architectures
|
||||
+ cpu_info = None
|
||||
|
||||
########### Check versions ##########
|
||||
def exit_with_error(message):
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
From 8185dc37e0c03b62268c025e7b59bb4e8644f6a1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sat, 13 Jul 2019 00:36:49 +0200
|
||||
Subject: [PATCH] Read os-release instead of using
|
||||
platform.linux_distribution()
|
||||
|
||||
The function was removed in https://bugs.python.org/issue1322
|
||||
and cannot be used in python3.8.
|
||||
|
||||
There are replacements outside of the stdlib, but it doesn't seem
|
||||
worth it it add a dependency on another module. Instead, a simple
|
||||
parser for os-release is implemented. os-release is present on all
|
||||
distros from the last few years and PRETTY_NAME gives a reliable
|
||||
display name of the distro without any heuristics.
|
||||
---
|
||||
blosc/toplevel.py | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blosc/toplevel.py b/blosc/toplevel.py
|
||||
index 04ad9f0217..94cf4af910 100644
|
||||
--- a/blosc/toplevel.py
|
||||
+++ b/blosc/toplevel.py
|
||||
@@ -800,6 +800,20 @@ def load_tests(loader, tests, pattern):
|
||||
tests.addTests(doctest.DocTestSuite())
|
||||
return tests
|
||||
|
||||
+def os_release_pretty_name():
|
||||
+ for p in ('/etc/os-release', '/usr/lib/os-release'):
|
||||
+ try:
|
||||
+ f = open(p, 'rt')
|
||||
+ for line in f:
|
||||
+ name, _, value = line.rstrip().partition('=')
|
||||
+ if name == 'PRETTY_NAME':
|
||||
+ if len(value) >= 2 and value[0] in '"\'' and value[0] == value[-1]:
|
||||
+ value = value[1:-1]
|
||||
+ return value
|
||||
+ except IOError:
|
||||
+ pass
|
||||
+ else:
|
||||
+ return None
|
||||
|
||||
def print_versions():
|
||||
"""Print all the versions of software that python-blosc relies on."""
|
||||
@@ -815,7 +829,9 @@ def print_versions():
|
||||
(sysname, nodename, release, version, machine, processor) = platform.uname()
|
||||
print("Platform: %s-%s-%s (%s)" % (sysname, release, machine, version))
|
||||
if sysname == "Linux":
|
||||
- print("Linux dist: %s" % " ".join(platform.linux_distribution()[:-1]))
|
||||
+ distro = os_release_pretty_name()
|
||||
+ if distro:
|
||||
+ print("Linux dist:", distro)
|
||||
if not processor:
|
||||
processor = "not recognized"
|
||||
print("Processor: %s" % processor)
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
diff --git a/blosc/toplevel.py b/blosc/toplevel.py
|
||||
index 94cf4af..2fa2c49 100644
|
||||
--- a/blosc/toplevel.py
|
||||
+++ b/blosc/toplevel.py
|
||||
@@ -435,9 +435,9 @@ def compress(bytesobj, typesize=8, clevel=9, shuffle=blosc.SHUFFLE,
|
||||
Examples
|
||||
--------
|
||||
|
||||
- >>> import array
|
||||
+ >>> import array, sys
|
||||
>>> a = array.array('i', range(1000*1000))
|
||||
- >>> a_bytesobj = a.tostring()
|
||||
+ >>> a_bytesobj = a.tobytes() if sys.version_info >= (3, 0, 0) else a.tostring()
|
||||
>>> c_bytesobj = blosc.compress(a_bytesobj, typesize=4)
|
||||
>>> len(c_bytesobj) < len(a_bytesobj)
|
||||
True
|
||||
@@ -574,9 +574,9 @@ def decompress(bytesobj, as_bytearray=False):
|
||||
Examples
|
||||
--------
|
||||
|
||||
- >>> import array
|
||||
+ >>> import array, sys
|
||||
>>> a = array.array('i', range(1000*1000))
|
||||
- >>> a_bytesobj = a.tostring()
|
||||
+ >>> a_bytesobj = a.tobytes() if sys.version_info >= (3, 0, 0) else a.tostring()
|
||||
>>> c_bytesobj = blosc.compress(a_bytesobj, typesize=4)
|
||||
>>> a_bytesobj2 = blosc.decompress(c_bytesobj)
|
||||
>>> a_bytesobj == a_bytesobj2
|
||||
160
changelog
Normal file
160
changelog
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Tue Jun 15 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.10.4-1
|
||||
- Latest bugfix version (#1966828)
|
||||
|
||||
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.10.2-2
|
||||
- Rebuilt for Python 3.10
|
||||
|
||||
* Sat Feb 13 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.10.2-1
|
||||
- Latest version (#1783504)
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed May 27 2020 Charalampos Stratakis <cstratak@redhat.com> - 1.8.1-7
|
||||
- Fix Python 3.9 compatibility (#1792055)
|
||||
|
||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-6
|
||||
- Rebuilt for Python 3.9
|
||||
|
||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-4
|
||||
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
||||
|
||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-3
|
||||
- Rebuilt for Python 3.8
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun May 5 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.8.1-1
|
||||
- Update to latest version (#1684965)
|
||||
|
||||
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Wed Oct 17 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.5.1-2
|
||||
- Subpackage python2-blosc has been removed
|
||||
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
|
||||
|
||||
* Thu Jul 19 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.5.1-1
|
||||
- Update to latest version (#1372856)
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.4.1-8
|
||||
- Rebuilt for Python 3.7
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Thu Jan 05 2017 Dan Horák <dan[at]danny.cz> - 1.4.1-3
|
||||
- remove build time CPU detection, fixed build on ppc64/ppc64le and s390(x)
|
||||
|
||||
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.4.1-2
|
||||
- Rebuild for Python 3.6
|
||||
|
||||
* Thu Jul 28 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4.1-1
|
||||
- Update to latest version (#1323008)
|
||||
|
||||
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.3-2
|
||||
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
||||
|
||||
* Thu Jul 14 2016 Thibault North <tnorth@fedoraproject.org> - 1.3.3-1
|
||||
- Update to 1.3.3
|
||||
|
||||
* Mon May 16 2016 Orion Poplawski <orion@cora.nwra.com> - 1.3.2-1
|
||||
- Update to 1.3.2
|
||||
|
||||
* Mon May 16 2016 Orion Poplawski <orion@cora.nwra.com> - 1.2.8-3
|
||||
- Fix provides filter
|
||||
- Use %%python3_pkgversion for EPEL7 compatibility
|
||||
|
||||
* Sat Feb 13 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@bupkis> - 1.2.8-2
|
||||
- Add dependency on psutil to check for leaks during build
|
||||
- Fix build (#1307896)
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.8-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Mon Nov 16 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.8-1
|
||||
- Update to latest version (#1263680)
|
||||
- Add python2 subpackage following the latest guidelines
|
||||
|
||||
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.7-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
|
||||
|
||||
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.7-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Fri May 29 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-3
|
||||
- Run test suite
|
||||
|
||||
* Thu May 28 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-2
|
||||
- Build python 3 subpackage
|
||||
- Install license and readme files
|
||||
|
||||
* Thu May 7 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-1
|
||||
- Update to 1.2.7 (#1212231)
|
||||
|
||||
* Mon Apr 20 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.5-1
|
||||
- Update to 1.2.5 (#1212231)
|
||||
|
||||
* Tue Jan 06 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.4-1
|
||||
- Update to 1.2.4
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Wed Mar 26 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.3-2
|
||||
- Rebuild for blosc
|
||||
|
||||
* Sat Mar 22 2014 Thibault North <tnorth@fedoraproject.org> - 1.2.3-1
|
||||
- Update to 1.2.3 for blosc 1.3.4
|
||||
|
||||
* Wed Jan 08 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1-8
|
||||
- Rebuild for blosc
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-7
|
||||
- Properly link with blosc shared lib
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-6
|
||||
- Disable SSE2 optimizations
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-5
|
||||
- Final cosmetic fixes
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-4
|
||||
- Fix wrong lib perms
|
||||
|
||||
* Fri Oct 18 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-3
|
||||
- Fixes, thanks to Christopher Meng
|
||||
|
||||
* Wed Oct 16 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-2
|
||||
- Various fixes
|
||||
|
||||
* Fri Sep 20 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-1
|
||||
- Sync to version 1.1
|
||||
|
||||
* Mon Jan 2 2012 Thibault North <tnorth@fedoraproject.org> - 1.0.7-1
|
||||
- Initial package
|
||||
|
|
@ -1,24 +1,18 @@
|
|||
Summary: Python wrapper for the Blosc high performance compressor
|
||||
Name: python-blosc
|
||||
Version: 1.8.1
|
||||
Release: 8%{?dist}
|
||||
License: MIT
|
||||
Summary: Python wrapper for the Blosc high performance compressor
|
||||
Version: 1.11.3
|
||||
Release: %autorelease
|
||||
License: BSD-3-Clause
|
||||
URL: https://github.com/Blosc/python-blosc
|
||||
Source0: https://github.com/Blosc/python-blosc/archive/v%{version}/blosc-%{version}.tar.gz
|
||||
Source1: https://raw.githubusercontent.com/Blosc/python-blosc/f3c5e341a2504a03c225f4f1d9066ccdf4bd31dd/setup.py
|
||||
|
||||
# https://github.com/Blosc/python-blosc/pull/200
|
||||
Patch1: 0001-blosc_extenion-constify-char-pointers-for-Py_BuildVa.patch
|
||||
Patch2: 0002-setup.py-unbreak-build-on-architectures-which-don-t-.patch
|
||||
Patch3: 0003-setup.py-catch-import-error-for-cpuinfo.patch
|
||||
# https://github.com/Blosc/python-blosc/pull/202
|
||||
Patch4: 0004-Read-os-release-instead-of-using-platform.linux_dist.patch
|
||||
# Fix Python 3.9 compatibility
|
||||
# https://github.com/Blosc/python-blosc/pull/218
|
||||
Patch5: 0005-fix-python-3.9-compatibility.patch
|
||||
Patch: 0001-docs-update-example-for-newer-numpy.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: blosc-devel >= 1.16.0
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||
BuildRequires: python%{python3_pkgversion}-numpy
|
||||
BuildRequires: python%{python3_pkgversion}-psutil
|
||||
BuildRequires: python%{python3_pkgversion}-cpuinfo
|
||||
|
|
@ -38,8 +32,9 @@ Requires: blosc%{_isa} >= 1.16.0
|
|||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
# Remove bundled copy
|
||||
rm cpuinfo.py
|
||||
|
||||
# Overwrite setup.py with the last version that does not use skbuild and cmake
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
export BLOSC_DIR=%{_libdir}/blosc CFLAGS="%{optflags}"
|
||||
|
|
@ -56,152 +51,8 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %__python3 -c 'import sys, blosc; sys
|
|||
%files -n python%{python3_pkgversion}-blosc
|
||||
%{python3_sitearch}/blosc/
|
||||
%{python3_sitearch}/blosc-%{version}*-py*.egg-info
|
||||
%license LICENSES/PYTHON-BLOSC.txt
|
||||
%license LICENSE.txt
|
||||
%doc README.rst RELEASE_NOTES.rst
|
||||
|
||||
%changelog
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed May 27 2020 Charalampos Stratakis <cstratak@redhat.com> - 1.8.1-7
|
||||
- Fix Python 3.9 compatibility (#1792055)
|
||||
|
||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-6
|
||||
- Rebuilt for Python 3.9
|
||||
|
||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-4
|
||||
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
||||
|
||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-3
|
||||
- Rebuilt for Python 3.8
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun May 5 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.8.1-1
|
||||
- Update to latest version (#1684965)
|
||||
|
||||
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Wed Oct 17 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.5.1-2
|
||||
- Subpackage python2-blosc has been removed
|
||||
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
|
||||
|
||||
* Thu Jul 19 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.5.1-1
|
||||
- Update to latest version (#1372856)
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.4.1-8
|
||||
- Rebuilt for Python 3.7
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Thu Jan 05 2017 Dan Horák <dan[at]danny.cz> - 1.4.1-3
|
||||
- remove build time CPU detection, fixed build on ppc64/ppc64le and s390(x)
|
||||
|
||||
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.4.1-2
|
||||
- Rebuild for Python 3.6
|
||||
|
||||
* Thu Jul 28 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4.1-1
|
||||
- Update to latest version (#1323008)
|
||||
|
||||
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.3-2
|
||||
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
||||
|
||||
* Thu Jul 14 2016 Thibault North <tnorth@fedoraproject.org> - 1.3.3-1
|
||||
- Update to 1.3.3
|
||||
|
||||
* Mon May 16 2016 Orion Poplawski <orion@cora.nwra.com> - 1.3.2-1
|
||||
- Update to 1.3.2
|
||||
|
||||
* Mon May 16 2016 Orion Poplawski <orion@cora.nwra.com> - 1.2.8-3
|
||||
- Fix provides filter
|
||||
- Use %%python3_pkgversion for EPEL7 compatibility
|
||||
|
||||
* Sat Feb 13 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@bupkis> - 1.2.8-2
|
||||
- Add dependency on psutil to check for leaks during build
|
||||
- Fix build (#1307896)
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.8-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Mon Nov 16 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.8-1
|
||||
- Update to latest version (#1263680)
|
||||
- Add python2 subpackage following the latest guidelines
|
||||
|
||||
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.7-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
|
||||
|
||||
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.7-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Fri May 29 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-3
|
||||
- Run test suite
|
||||
|
||||
* Thu May 28 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-2
|
||||
- Build python 3 subpackage
|
||||
- Install license and readme files
|
||||
|
||||
* Thu May 7 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-1
|
||||
- Update to 1.2.7 (#1212231)
|
||||
|
||||
* Mon Apr 20 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.5-1
|
||||
- Update to 1.2.5 (#1212231)
|
||||
|
||||
* Tue Jan 06 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.4-1
|
||||
- Update to 1.2.4
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Wed Mar 26 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.3-2
|
||||
- Rebuild for blosc
|
||||
|
||||
* Sat Mar 22 2014 Thibault North <tnorth@fedoraproject.org> - 1.2.3-1
|
||||
- Update to 1.2.3 for blosc 1.3.4
|
||||
|
||||
* Wed Jan 08 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1-8
|
||||
- Rebuild for blosc
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-7
|
||||
- Properly link with blosc shared lib
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-6
|
||||
- Disable SSE2 optimizations
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-5
|
||||
- Final cosmetic fixes
|
||||
|
||||
* Tue Nov 05 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-4
|
||||
- Fix wrong lib perms
|
||||
|
||||
* Fri Oct 18 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-3
|
||||
- Fixes, thanks to Christopher Meng
|
||||
|
||||
* Wed Oct 16 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-2
|
||||
- Various fixes
|
||||
|
||||
* Fri Sep 20 2013 Thibault North <tnorth@fedoraproject.org> - 1.1-1
|
||||
- Sync to version 1.1
|
||||
|
||||
* Mon Jan 2 2012 Thibault North <tnorth@fedoraproject.org> - 1.0.7-1
|
||||
- Initial package
|
||||
%autochangelog
|
||||
|
|
|
|||
327
setup.py
Normal file
327
setup.py
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
########################################################################
|
||||
#
|
||||
# License: BSD 3-clause
|
||||
# Created: September 22, 2010
|
||||
# Author: Francesc Alted - faltet@gmail.com
|
||||
#
|
||||
########################################################################
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import io
|
||||
|
||||
from setuptools import Extension
|
||||
from setuptools import setup
|
||||
from glob import glob
|
||||
from distutils.version import LooseVersion
|
||||
from distutils.command.build_ext import build_ext
|
||||
from distutils.errors import CompileError
|
||||
from textwrap import dedent
|
||||
|
||||
|
||||
class BloscExtension(Extension):
|
||||
"""Allows extension to carry architecture-capable flag options.
|
||||
|
||||
Attributes:
|
||||
avx2_def (Dict[str]: List[str]):
|
||||
AVX2 support dictionary mapping Extension properties to a
|
||||
list of values. If compiler is AVX2 capable, then these will
|
||||
be appended onto the end of the Extension properties.
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.avx2_defs = kwargs.pop("avx2_defs", {})
|
||||
Extension.__init__(self, *args, **kwargs)
|
||||
|
||||
|
||||
class build_ext_posix_avx2(build_ext):
|
||||
"""build_ext customized to test for AVX2 support in posix compiler.
|
||||
|
||||
This is because until distutils has actually started the build
|
||||
process, we can't be certain what compiler is being used.
|
||||
|
||||
If compiler supports, then the avx2_defs dictionary on any given
|
||||
Extension will be used to extend the other Extension attributes.
|
||||
"""
|
||||
|
||||
def _test_compiler_flags(self, name, flags):
|
||||
# type: (List[str]) -> Bool
|
||||
"""Test that a sample program can compile with given flags.
|
||||
|
||||
Attr:
|
||||
flags (List[str]): the flags to test
|
||||
name (str): An identifier-like name to cache the results as
|
||||
|
||||
Returns:
|
||||
(bool): Whether the compiler accepted the flags(s)
|
||||
"""
|
||||
# Look to see if we have a written file to cache the result
|
||||
success_file = os.path.join(self.build_temp, "_{}_present".format(name))
|
||||
fail_file = os.path.join(self.build_temp, "_{}_failed".format(name))
|
||||
if os.path.isfile(success_file):
|
||||
return True
|
||||
elif os.path.isfile(fail_file):
|
||||
return False
|
||||
# No cache file, try to run the compile
|
||||
try:
|
||||
# Write an empty test file
|
||||
test_file = os.path.join(self.build_temp, "test_{}_empty.c".format(name))
|
||||
if not os.path.isfile(test_file):
|
||||
open(test_file, "w").close()
|
||||
objects = self.compiler.compile(
|
||||
[test_file], output_dir=self.build_temp, extra_postargs=flags
|
||||
)
|
||||
# Write a success marker so we don't need to compile again
|
||||
open(success_file, 'w').close()
|
||||
return True
|
||||
except CompileError:
|
||||
# Write a failure marker so we don't need to compile again
|
||||
open(fail_file, 'w').close()
|
||||
return False
|
||||
finally:
|
||||
pass
|
||||
|
||||
def build_extensions(self):
|
||||
# Verify that the compiler supports requested extra flags
|
||||
if self._test_compiler_flags("avx2", ["-mavx2"]):
|
||||
# Apply the AVX2 properties to each extension
|
||||
for extension in self.extensions:
|
||||
if hasattr(extension, "avx2_defs"):
|
||||
# Extend an existing attribute with the stored values
|
||||
for attr, defs in extension.avx2_defs.items():
|
||||
getattr(extension, attr).extend(defs)
|
||||
else:
|
||||
print("AVX2 Unsupported by compiler")
|
||||
|
||||
# Call up to the superclass to do the actual build
|
||||
build_ext.build_extensions(self)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
with io.open('README.rst', encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
try:
|
||||
import cpuinfo
|
||||
cpu_info = cpuinfo.get_cpu_info()
|
||||
except Exception:
|
||||
# newer cpuinfo versions fail to import on unsupported architectures
|
||||
cpu_info = None
|
||||
|
||||
########### Check versions ##########
|
||||
def exit_with_error(message):
|
||||
print('ERROR: %s' % message)
|
||||
sys.exit(1)
|
||||
|
||||
# Check for Python
|
||||
if sys.version_info[0] == 2:
|
||||
if sys.version_info[1] < 7:
|
||||
exit_with_error("You need Python 2.7 or greater to install blosc!")
|
||||
elif sys.version_info[0] == 3:
|
||||
if sys.version_info[1] < 4:
|
||||
exit_with_error("You need Python 3.4 or greater to install blosc!")
|
||||
else:
|
||||
exit_with_error("You need Python 2.7/3.4 or greater to install blosc!")
|
||||
|
||||
tests_require = ['numpy', 'psutil']
|
||||
|
||||
########### End of checks ##########
|
||||
|
||||
# Read the long_description from README.rst
|
||||
with open('README.rst') as f:
|
||||
long_description = f.read()
|
||||
|
||||
# Blosc version
|
||||
VERSION = open('VERSION').read().strip()
|
||||
# Create the version.py file
|
||||
open('blosc/version.py', 'w').write('__version__ = "%s"\n' % VERSION)
|
||||
|
||||
# Global variables
|
||||
CFLAGS = os.environ.get('CFLAGS', '').split()
|
||||
LFLAGS = os.environ.get('LFLAGS', '').split()
|
||||
# Allow setting the Blosc dir if installed in the system
|
||||
BLOSC_DIR = os.environ.get('BLOSC_DIR', '')
|
||||
|
||||
# Check for USE_CODEC environment variables
|
||||
try:
|
||||
INCLUDE_LZ4 = os.environ['INCLUDE_LZ4'] == '1'
|
||||
except KeyError:
|
||||
INCLUDE_LZ4 = True
|
||||
try:
|
||||
INCLUDE_SNAPPY = os.environ['INCLUDE_SNAPPY'] == '1'
|
||||
except KeyError:
|
||||
INCLUDE_SNAPPY = False # Snappy is disabled by default
|
||||
try:
|
||||
INCLUDE_ZLIB = os.environ['INCLUDE_ZLIB'] == '1'
|
||||
except KeyError:
|
||||
INCLUDE_ZLIB = True
|
||||
try:
|
||||
INCLUDE_ZSTD = os.environ['INCLUDE_ZSTD'] == '1'
|
||||
except KeyError:
|
||||
INCLUDE_ZSTD = True
|
||||
|
||||
|
||||
# Handle --blosc=[PATH] --lflags=[FLAGS] --cflags=[FLAGS]
|
||||
args = sys.argv[:]
|
||||
for arg in args:
|
||||
if arg.find('--blosc=') == 0:
|
||||
BLOSC_DIR = os.path.expanduser(arg.split('=')[1])
|
||||
sys.argv.remove(arg)
|
||||
if arg.find('--lflags=') == 0:
|
||||
LFLAGS = arg.split('=')[1].split()
|
||||
sys.argv.remove(arg)
|
||||
if arg.find('--cflags=') == 0:
|
||||
CFLAGS = arg.split('=')[1].split()
|
||||
sys.argv.remove(arg)
|
||||
|
||||
|
||||
# Blosc sources and headers
|
||||
|
||||
# To avoid potential namespace collisions use build_clib.py for each codec
|
||||
# instead of co-compiling all sources files in one setuptools.Extension object.
|
||||
clibs = [] # for build_clib, libraries TO BE BUILT
|
||||
|
||||
# Below are parameters for the Extension object
|
||||
sources = ["blosc/blosc_extension.c"]
|
||||
inc_dirs = []
|
||||
lib_dirs = []
|
||||
libs = [] # Pre-built libraries ONLY, like python36.so
|
||||
def_macros = []
|
||||
builder_class = build_ext # To swap out if we have AVX capability and posix
|
||||
avx2_defs = {} # Definitions to build extension with if compiler supports AVX2
|
||||
|
||||
if BLOSC_DIR != '':
|
||||
# Using the Blosc library
|
||||
lib_dirs += [os.path.join(BLOSC_DIR, 'lib')]
|
||||
inc_dirs += [os.path.join(BLOSC_DIR, 'include')]
|
||||
libs += ['blosc']
|
||||
else:
|
||||
|
||||
# Configure the Extension
|
||||
# Compiling everything from included C-Blosc sources
|
||||
sources += [f for f in glob('c-blosc/blosc/*.c')
|
||||
if 'avx2' not in f and 'sse2' not in f]
|
||||
|
||||
inc_dirs += [os.path.join('c-blosc', 'blosc')]
|
||||
inc_dirs += glob('c-blosc/internal-complibs/*')
|
||||
|
||||
# Codecs to be built with build_clib
|
||||
if INCLUDE_LZ4:
|
||||
clibs.append( ('lz4', {'sources': glob('c-blosc/internal-complibs/lz4*/*.c')} ) )
|
||||
inc_dirs += glob('c-blosc/internal-complibs/lz4*')
|
||||
def_macros += [('HAVE_LZ4',1)]
|
||||
|
||||
# Tried and failed to compile Snappy with gcc using 'cflags' on posix
|
||||
# setuptools always uses gcc instead of g++, as it only checks for the
|
||||
# env var 'CC' and not 'CXX'.
|
||||
if INCLUDE_SNAPPY:
|
||||
clibs.append( ('snappy', {'sources': glob('c-blosc/internal-complibs/snappy*/*.cc'),
|
||||
'cflags': ['-std=c++11', '-lstdc++'] } ) )
|
||||
inc_dirs += glob('c-blosc/internal-complibs/snappy*')
|
||||
def_macros += [('HAVE_SNAPPY',1)]
|
||||
|
||||
if INCLUDE_ZLIB:
|
||||
clibs.append( ('zlib', {'sources': glob('c-blosc/internal-complibs/zlib*/*.c')} ) )
|
||||
def_macros += [('HAVE_ZLIB',1)]
|
||||
|
||||
if INCLUDE_ZSTD:
|
||||
clibs.append( ('zstd', {'sources': glob('c-blosc/internal-complibs/zstd*/*/*.c'),
|
||||
'include_dirs': glob('c-blosc/internal-complibs/zstd*') + glob('c-blosc/internal-complibs/zstd*/common') } ) )
|
||||
inc_dirs += glob('c-blosc/internal-complibs/zstd*/common')
|
||||
inc_dirs += glob('c-blosc/internal-complibs/zstd*')
|
||||
def_macros += [('HAVE_ZSTD',1)]
|
||||
|
||||
|
||||
# Guess SSE2 or AVX2 capabilities
|
||||
# SSE2
|
||||
if 'DISABLE_BLOSC_SSE2' not in os.environ and cpu_info != None and 'sse2' in cpu_info.get('flags', {}):
|
||||
print('SSE2 detected')
|
||||
CFLAGS.append('-DSHUFFLE_SSE2_ENABLED')
|
||||
sources += [f for f in glob('c-blosc/blosc/*.c') if 'sse2' in f]
|
||||
if os.name == 'posix':
|
||||
CFLAGS.append('-msse2')
|
||||
elif os.name == 'nt':
|
||||
def_macros += [('__SSE2__', 1)]
|
||||
# AVX2
|
||||
if 'DISABLE_BLOSC_AVX2' not in os.environ and cpu_info != None and 'sse2' in cpu_info.get('flags', {}):
|
||||
if os.name == 'posix':
|
||||
print("AVX2 detected")
|
||||
avx2_defs = {
|
||||
"extra_compile_args": ["-DSHUFFLE_AVX2_ENABLED", "-mavx2"],
|
||||
"sources": [f for f in glob("c-blosc/blosc/*.c") if "avx2" in f]
|
||||
}
|
||||
# The CPU supports it but the compiler might not..
|
||||
builder_class = build_ext_posix_avx2
|
||||
elif(os.name == 'nt' and
|
||||
LooseVersion(platform.python_version()) >= LooseVersion('3.5.0')):
|
||||
# Neither MSVC2008 for Python 2.7 or MSVC2010 for Python 3.4 have
|
||||
# sufficient AVX2 support
|
||||
# Since we don't rely on any special compiler capabilities,
|
||||
# we don't need to rely on testing the compiler
|
||||
print('AVX2 detected')
|
||||
CFLAGS.append('-DSHUFFLE_AVX2_ENABLED')
|
||||
sources += [f for f in glob('c-blosc/blosc/*.c') if 'avx2' in f]
|
||||
def_macros += [('__AVX2__', 1)]
|
||||
# TODO: AVX512
|
||||
|
||||
classifiers = dedent("""\
|
||||
Development Status :: 5 - Production/Stable
|
||||
Intended Audience :: Developers
|
||||
Intended Audience :: Information Technology
|
||||
Intended Audience :: Science/Research
|
||||
License :: OSI Approved :: BSD License
|
||||
Programming Language :: Python
|
||||
Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3.4
|
||||
Programming Language :: Python :: 3.5
|
||||
Programming Language :: Python :: 3.6
|
||||
Programming Language :: Python :: 3.7
|
||||
Topic :: Software Development :: Libraries :: Python Modules
|
||||
Topic :: System :: Archiving :: Compression
|
||||
Operating System :: Microsoft :: Windows
|
||||
Operating System :: Unix
|
||||
""")
|
||||
|
||||
setup(name = "blosc",
|
||||
version = VERSION,
|
||||
description = 'Blosc data compressor',
|
||||
long_description = long_description,
|
||||
classifiers = [c for c in classifiers.split("\n") if c],
|
||||
author = 'Francesc Alted, Valentin Haenel',
|
||||
author_email = 'faltet@gmail.com, valentin@haenel.co',
|
||||
maintainer = 'Francesc Alted, Valentin Haenel',
|
||||
maintainer_email = 'faltet@gmail.com, valentin@haenel.co',
|
||||
url = 'http://github.com/blosc/python-blosc',
|
||||
license = 'https://opensource.org/licenses/BSD-3-Clause',
|
||||
platforms = ['any'],
|
||||
libraries = clibs,
|
||||
ext_modules = [
|
||||
BloscExtension( "blosc.blosc_extension",
|
||||
include_dirs=inc_dirs,
|
||||
define_macros=def_macros,
|
||||
sources=sources,
|
||||
library_dirs=lib_dirs,
|
||||
libraries=libs,
|
||||
extra_link_args=LFLAGS,
|
||||
extra_compile_args=CFLAGS,
|
||||
avx2_defs=avx2_defs
|
||||
),
|
||||
],
|
||||
tests_require=tests_require,
|
||||
zip_safe=False,
|
||||
packages = ['blosc'],
|
||||
cmdclass={'build_ext': builder_class},
|
||||
)
|
||||
elif __name__ == '__mp_main__':
|
||||
# This occurs from `cpuinfo 4.0.0` using multiprocessing to interrogate the
|
||||
# CPUID flags
|
||||
# https://github.com/workhorsy/py-cpuinfo/issues/108
|
||||
pass
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (blosc-1.8.1.tar.gz) = f8cc5b38f2bdeac6b173e800313a3b71ba5b22b681e0ca90f3cdbf2fdb2c82826d478279297ffc2c91ce36ce21367c744e12b41e37a912deb4bdf1849e7359fa
|
||||
SHA512 (blosc-1.11.3.tar.gz) = fc82b7b100d306965874868b2a0b1b6a9b865f1ba86ce65546aeb8212ba5085ef7a565f46ac3b40f648641d449d9f5265087ca8670075221ba8018dc8efd7be4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue