0
0
Fork 0
haikuports/sci-libs/armadillo/armadillo9-9.880.1.recipe

99 lines
2.4 KiB
Bash

SUMMARY="A C++ linear algebra library"
DESCRIPTION="The library provides efficient classes for vectors, matrices and \
cubes, as well as 200+ associated functions (eg. contiguous and non-contiguous \
submatrix views). Various matrix decompositions are provided through \
integration with LAPACK, or one of its high performance drop-in replacements."
HOMEPAGE="http://arma.sourceforge.net/"
COPYRIGHT="2008-2019 Conrad Sanderson
2008-2016 National ICT Australia (NICTA)
2017-2019 Arroyo Consortium
2017-2019 Data61, CSIRO"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://downloads.sourceforge.net/arma/armadillo-$portVersion.tar.xz"
CHECKSUM_SHA256="900f3e8d35d8b722217bed979fa618faf6f3e4f56964c887a1fce44c3d4c4b9f"
SOURCE_DIR="armadillo-$portVersion"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
armadillo9$secondaryArchSuffix = $portVersion
lib:libarmadillo$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libarpack$secondaryArchSuffix
lib:libhdf5$secondaryArchSuffix
lib:liblapack$secondaryArchSuffix
lib:libopenblas$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libarpack$secondaryArchSuffix
devel:libhdf5$secondaryArchSuffix
devel:liblapack$secondaryArchSuffix
devel:libopenblas$secondaryArchSuffix
devel:libsuperlu$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:g++$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:sed
"
defineDebugInfoPackage armadillo9$secondaryArchSuffix \
"$libDir"/libarmadillo.so.$libVersion
PATCH()
{
# Enable some optional features
sed --regexp-extended -i '/ARMA_USE_(SUPERLU|ARPACK)/s/^\/\///g' include/armadillo_bits/config.hpp
}
BUILD()
{
mkdir -p build && cd "$_"
cmake .. \
-DDETECT_HDF5=ON \
-DBUILD_SHARED_LIBS=ON \
$cmakeDirArgs
make $jobArgs
}
INSTALL()
{
cd build
make install
rm -rf $dataDir/Armadillo/
prepareInstalledDevelLib libarmadillo
fixPkgconfig
rm -rf $developDir
}
TEST()
{
export LIBRARY_PATH=$LIBRARY_PATH:$sourceDir/build
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$sourceDir/include
sed -i "s|LIB_FLAGS = -larmadillo|LIB_FLAGS = -lopenblas -llapack -larpack -lsuperlu -larmadillo -L$sourceDir/build|g" tests/Makefile
make -C tests all $jobArgs
./tests/main
}