SUMMARY="A C++ math library for dense and sparse arithmetic"
DESCRIPTION="The Blaze library offers :
* high performance through the integration of BLAS libraries and manually \
tuned HPC math kernels
* vectorization by SSE, SSE2, SSE3, SSSE3, SSE4, AVX, AVX2, AVX-512, FMA, \
and SVML
* parallel execution by OpenMP, C++11 threads and Boost threads
* the intuitive and easy to use API of a domain specific language
* unified arithmetic with dense and sparse vectors and matrices
* thoroughly tested matrix and vector arithmetic
* completely portable, high quality C++ source code"
HOMEPAGE="https://bitbucket.org/blaze-lib/blaze/"
COPYRIGHT="2012-2020 Klaus Iglberger"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://bitbucket.org/blaze-lib/blaze/downloads/blaze-$portVersion.tar.gz"
CHECKSUM_SHA256="dfaae1a3a9fea0b3cc92e78c9858dcc6c93301d59f67de5d388a3a41c8a629ae"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	blaze$secondaryArchSuffix = $portVersion
	devel:blaze$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libboost_system$secondaryArchSuffix
	lib:liblapack$secondaryArchSuffix
	lib:libopenblas$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libboost_system$secondaryArchSuffix
	devel:liblapack$secondaryArchSuffix
	devel:libopenblas$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	mkdir -p build && cd "$_"

	cmake .. \
		$cmakeDirArgs


	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	mkdir -p $includeDir $libDir
	mv $prefix/include/blaze $includeDir
	mv $prefix/share/blaze/cmake $libDir
	rmdir $prefix/include $prefix/share/blaze $prefix/share
}

TEST()
{
	#make test
	# blaze provides no tests
	true
}
