dev-libs/zfp: initial import

Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2021-06-14 12:31:29 +02:00
parent 7cf107db9c
commit e83a785b7e
3 changed files with 113 additions and 0 deletions

1
dev-libs/zfp/Manifest Normal file
View File

@@ -0,0 +1 @@
DIST zfp-0.5.5.tar.gz 127482 BLAKE2B 2a3bfca4280c15c8679d1af23ff1b5e09de07060ecb120ce399a56bf598c7a934dbf8053ffd9b6bd26c81641d2f46557d5ad71c3abffefa475eaaaaaf28c8286 SHA512 c043cee73f6e972e047452552ab2ceb9247a6747fdb7e5f863aeab3a05208737c0bcabbe29f3c10e5c1aba961ec47aa6a0abdb395486fa0d5fb16a4ad45733c4

31
dev-libs/zfp/metadata.xml Normal file
View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<longdescription>
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.
</longdescription>
<maintainer type="person">
<email>lssndrbarbieri@gmail.com</email>
<name>Alessandro Barbieri</name>
</maintainer>
<upstream>
<bugs-to>https://github.com/LLNL/zfp/issues</bugs-to>
<remote-id type="github">LLNL/zfp</remote-id>
</upstream>
<use>
<flag name="aligned">Enable aligned memory allocation</flag>
<flag name="cfp">Build CFP arrays library</flag>
<!--<flag name="cuda">Enable CUDA parallel compression</flag>-->
<flag name="examples">Build Examples</flag>
<flag name="fasthash">Use a faster but more collision prone hash function</flag>
<flag name="fortran">Build Fortran library</flag>
<flag name="openmp">Enable OpenMP parallel compression</flag>
<flag name="strided">Enable strided access for progressive zfp streams</flag>
<flag name="twoway">Use two-way skew-associative cache</flag>
<flag name="utilities">Build command line utilities</flag>
</use>
</pkgmetadata>

View File

@@ -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
}