From e83a785b7e73aa903f3fd4fcc21ef1d173076ddd Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Mon, 14 Jun 2021 12:31:29 +0200 Subject: [PATCH] dev-libs/zfp: initial import Signed-off-by: Alessandro Barbieri --- dev-libs/zfp/Manifest | 1 + dev-libs/zfp/metadata.xml | 31 ++++++++++++++ dev-libs/zfp/zfp-0.5.5.ebuild | 81 +++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 dev-libs/zfp/Manifest create mode 100644 dev-libs/zfp/metadata.xml create mode 100644 dev-libs/zfp/zfp-0.5.5.ebuild diff --git a/dev-libs/zfp/Manifest b/dev-libs/zfp/Manifest new file mode 100644 index 0000000000..dc662e908d --- /dev/null +++ b/dev-libs/zfp/Manifest @@ -0,0 +1 @@ +DIST zfp-0.5.5.tar.gz 127482 BLAKE2B 2a3bfca4280c15c8679d1af23ff1b5e09de07060ecb120ce399a56bf598c7a934dbf8053ffd9b6bd26c81641d2f46557d5ad71c3abffefa475eaaaaaf28c8286 SHA512 c043cee73f6e972e047452552ab2ceb9247a6747fdb7e5f863aeab3a05208737c0bcabbe29f3c10e5c1aba961ec47aa6a0abdb395486fa0d5fb16a4ad45733c4 diff --git a/dev-libs/zfp/metadata.xml b/dev-libs/zfp/metadata.xml new file mode 100644 index 0000000000..6da34b25c5 --- /dev/null +++ b/dev-libs/zfp/metadata.xml @@ -0,0 +1,31 @@ + + + + +zfp is a compressed format for representing multidimensional floating-point and integer arrays. zfp provides compressed-array classes that support high throughput read and write random access to individual array elements. zfp also supports serial and parallel (OpenMP and CUDA) compression of whole arrays, e.g., for applications that read and write large data sets to and from disk. + +zfp uses lossy but optionally error-bounded compression to achieve high compression ratios. Bit-for-bit lossless compression is also possible through one of zfp's compression modes. zfp works best for 2D, 3D, and 4D arrays that exhibit spatial correlation, such as continuous fields from physics simulations, natural images, regularly sampled terrain surfaces, etc. zfp compression of 1D arrays is possible but generally discouraged. + +zfp is freely available as open source and is distributed under a BSD license. zfp is primarily written in C and C++ but also includes Python and Fortran bindings. zfp conforms to various language standards, including C89, C99, C11, C++98, C++11, and C++14, and is supported on Linux, macOS, and Windows. + + + lssndrbarbieri@gmail.com + Alessandro Barbieri + + + https://github.com/LLNL/zfp/issues + LLNL/zfp + + + Enable aligned memory allocation + Build CFP arrays library + + Build Examples + Use a faster but more collision prone hash function + Build Fortran library + Enable OpenMP parallel compression + Enable strided access for progressive zfp streams + Use two-way skew-associative cache + Build command line utilities + + diff --git a/dev-libs/zfp/zfp-0.5.5.ebuild b/dev-libs/zfp/zfp-0.5.5.ebuild new file mode 100644 index 0000000000..579abc781e --- /dev/null +++ b/dev-libs/zfp/zfp-0.5.5.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +#DOCS_BUILDER="sphinx" +#DOCS_DIR="docs/source" +PYTHON_COMPAT=( python3_{7,8,9,10} ) + +inherit cmake fortran-2 python-single-r1 #docs + +DESCRIPTION="Compressed numerical arrays that support high-speed random access" +SRC_URI="https://github.com/LLNL/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" +HOMEPAGE=" + https://computing.llnl.gov/projects/zfp + https://zfp.io + https://github.com/LLNL/ZFP +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="aligned cfp fasthash examples fortran openmp profile python strided test twoway +utilities" #doc cuda +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +RESTRICT="!test? ( test )" + +RDEPEND="python? ( ${PYTHON_DEPS} )" +DEPEND="${RDEPEND}" +BDEPEND="utilities? ( app-admin/chrpath )" + +pkg_setup() { + FORTRAN_NEED_OPENMP=0 + use openmp && FORTRAN_NEED_OPENMP=1 + use fortran && fortran-2_pkg_setup + python-single-r1_pkg_setup +} + +src_configure() { + #I can't test for cuda stuff + #-DZFP_WITH_CUDA=$(usex cuda) + local mycmakeargs=( + -DBUILD_CFP=$(usex cfp) + -DBUILD_EXAMPLES=$(usex examples) + -DBUILD_TESTING=$(usex test) + -DBUILD_UTILITIES=$(usex utilities) + -DBUILD_ZFORP=$(usex fortran) + -DBUILD_ZFPY=$(usex python) + -DZFP_WITH_ALIGNED_ALLOC=$(usex aligned) + -DZFP_WITH_BIT_STREAM_STRIDED=$(usex strided) + -DZFP_WITH_CACHE_FAST_HASH=$(usex fasthash) + -DZFP_WITH_CACHE_PROFILE=$(usex profile) + -DZFP_WITH_CACHE_TWOWAY=$(usex twoway) + -DZFP_WITH_OPENMP=$(usex openmp) + ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile + #docs only available starting from the next release + #use doc && docs_compile +} + +src_install() { + cmake_src_install + use python && python_optimize "${D}/$(python_get_sitedir)" + use test && rm "${BUILD_DIR}/bin/testzfp" + if use utilities; then + pushd "${BUILD_DIR}/bin" || die + dobin zfp + rm zfp + popd || die + chrpath -d "${ED}/usr/bin/zfp" || die + fi + if use examples; then + pushd "${BUILD_DIR}/bin" || die + exeinto "/usr/libexec/zfp" + doexe * + chrpath -d "${ED}"/usr/libexec/zfp/* || die + fi +}