Import Blosc 1.17.1

Blosc is a high performance compressor optimized for binary data. It has been
designed to transmit data to the processor cache faster than the traditional,
non-compressed, direct memory fetch approach via a memcpy() OS call. Blosc is
meant not only to reduce the size of large datasets on-disk or in-memory, but
also to accelerate memory-bound computations.

It uses the blocking technique so as to reduce activity in the memory bus as
much as possible. In short, this technique works by dividing datasets in blocks
that are small enough to fit in caches of modern processors and perform
compression/decompression there. It also leverages, if available, SIMD
instructions (SSE2, AVX2) and multi-threading capabilities of CPUs, in order to
accelerate the compression/decompression process to a maximum.

From martin@; input and OK from bcallah@, feinerer@, and sthen@
This commit is contained in:
feinerer 2019-12-19 07:00:24 +00:00
parent ce254b18ea
commit 5f3d820a3e
6 changed files with 106 additions and 0 deletions

35
archivers/blosc/Makefile Normal file
View File

@ -0,0 +1,35 @@
# $OpenBSD: Makefile,v 1.1.1.1 2019/12/19 07:00:24 feinerer Exp $
V = 1.17.1
COMMENT = blocking, shuffling, fast and lossless compression library
PKGNAME = blosc-${V}
CATEGORIES = archivers
SHARED_LIBS += blosc 0.0 # 1.0
GH_ACCOUNT = Blosc
GH_PROJECT = c-blosc
GH_TAGNAME = v${V}
HOMEPAGE = https://blosc.org/
MAINTAINER = Martin Reindl <martin@catai.org>
# BSD
PERMIT_PACKAGE = Yes
WANTLIB += lz4 pthread snappy z zstd
COMPILER = base-clang ports-gcc
MODULES = devel/cmake
LIB_DEPENDS = archivers/lz4 \
archivers/snappy \
archivers/zstd
CONFIGURE_ARGS = -DPREFER_EXTERNAL_LZ4=ON \
-DPREFER_EXTERNAL_SNAPPY=ON \
-DPREFER_EXTERNAL_ZLIB=ON \
-DPREFER_EXTERNAL_ZSTD=ON
.include <bsd.port.mk>

2
archivers/blosc/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (c-blosc-1.17.1.tar.gz) = GaaUi1ecJ+isRAtPB3+Z/JDnKSsdnLiWvsD9eB1o+6I=
SIZE (c-blosc-1.17.1.tar.gz) = 880237

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-bench_CMakeLists_txt,v 1.1.1.1 2019/12/19 07:00:24 feinerer Exp $
Index: bench/CMakeLists.txt
--- bench/CMakeLists.txt.orig
+++ bench/CMakeLists.txt
@@ -8,7 +8,7 @@ if(UNIX AND NOT APPLE AND NOT HAIKU)
# cmake is complaining about LINK_PRIVATE in original PR
# and removing it does not seem to hurt, so be it.
# target_link_libraries(bench LINK_PRIVATE rt)
- target_link_libraries(bench rt)
+ target_link_libraries(bench)
endif(UNIX AND NOT APPLE AND NOT HAIKU)
target_link_libraries(bench blosc_shared)

View File

@ -0,0 +1,36 @@
$OpenBSD: patch-tests_test_common_h,v 1.1.1.1 2019/12/19 07:00:24 feinerer Exp $
Our aligned_alloc(3) is C11, but more strict than on other platforms. Many tests
here fail with EINVAL if 'size' is not a multiple of 'alignment' _and_
alignment is not a power of 2. To better identify these cases, extend the error
message.
Index: tests/test_common.h
--- tests/test_common.h.orig
+++ tests/test_common.h
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -62,7 +63,7 @@ static void* blosc_test_malloc(const size_t alignment,
void *block = NULL;
int32_t res = 0;
-#if defined(_ISOC11_SOURCE) || (defined(__FreeBSD__) && __STDC_VERSION__ >= 201112L)
+#if defined(_ISOC11_SOURCE) || __STDC_VERSION__ >= 201112L
/* C11 aligned allocation. 'size' must be a multiple of the alignment. */
block = aligned_alloc(alignment, size);
#elif defined(_WIN32)
@@ -79,7 +80,7 @@ static void* blosc_test_malloc(const size_t alignment,
#endif
if (block == NULL || res != 0) {
- fprintf(stderr, "Error allocating memory!");
+ fprintf(stderr, "Error allocating memory: errno=%d, err_msg=\"%s\"\n", errno, strerror(errno));
return NULL;
}

13
archivers/blosc/pkg/DESCR Normal file
View File

@ -0,0 +1,13 @@
Blosc is a high performance compressor optimized for binary data. It has
been designed to transmit data to the processor cache faster than the
traditional, non-compressed, direct memory fetch approach via a memcpy()
OS call. Blosc is meant not only to reduce the size of large datasets
on-disk or in-memory, but also to accelerate memory-bound computations.
It uses the blocking technique so as to reduce activity in the memory
bus as much as possible. In short, this technique works by dividing
datasets in blocks that are small enough to fit in caches of modern
processors and perform compression/decompression there. It also
leverages, if available, SIMD instructions (SSE2, AVX2) and
multi-threading capabilities of CPUs, in order to accelerate the
compression/decompression process to a maximum.

View File

@ -0,0 +1,6 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/12/19 07:00:24 feinerer Exp $
include/blosc-export.h
include/blosc.h
@static-lib lib/libblosc.a
@lib lib/libblosc.so.${LIBblosc_VERSION}
lib/pkgconfig/blosc.pc