# Contributor: Isaac Dunham # Maintainer: Isaac Dunham pkgname=openblas pkgver=0.2.11 pkgrel=1 pkgdesc="A fast BSD-licensed BLAS based on gotoBLAS2, with LAPACK" url="http://www.openblas.net" arch="all" license="BSD" depends="" depends_dev="gfortran" makedepends="$depends_dev perl" install="" subpackages="$pkgname-dev $pkgname-doc" source="$pkgname-$pkgver.tar.gz::http://github.com/xianyi/OpenBLAS/archive/v$pkgver.tar.gz 00-cpuid.patch" _builddir="$srcdir"/OpenBLAS-$pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir" #USE_OPENMP=0: see GCC bug 60035 #NO_AFFINITY: don't expect to work on musl, also breaks R #DYNAMIC_ARCH=1 requires 00-cpuid.patch make USE_OPENMP=0 NO_LAPACK=0 NUM_THREADS=8 MAJOR_VERSION=3 \ NO_AFFINITY=1 DYNAMIC_ARCH=1 PREFIX=/usr || return 1 } package() { cd "$_builddir" mkdir -pm 0755 "$pkgdir/usr/lib" "$pkgdir/usr/include" \ "$pkgdir/usr/share/doc/$pkgname" || return 1 make USE_OPENMP=0 NO_LAPACK=0 NUM_THREADS=2 MAJOR_VERSION=3 \ NO_AFFINITY=1 DYNAMIC_ARCH=1 PREFIX="$pkgdir/usr" install || return 1 for FILE in *.txt *.md LICENSE; do install -m 0644 $FILE "$pkgdir/usr/share/doc/$pkgname" || return 1 done } md5sums="c456f3c5e84c3ab69ef89b22e616627a openblas-0.2.11.tar.gz 0b8b59052a6387fe4aa9e3e473b3749b 00-cpuid.patch" sha256sums="dc06836e700ef26519933af309a25958150693c376a536fe35d633d76f1a5606 openblas-0.2.11.tar.gz 65a809e9f0f06fd9ccefd0af6bc7c398fefe011404f699926946320783050d8b 00-cpuid.patch" sha512sums="68abdf8366d4766fe5d852ca3850ea6236d4dc5bad044fa4116ca60872716003746bcfdb1005aac87533d9a085ae319ef18b7ed6f293baf88c79fd7c8562c9f0 openblas-0.2.11.tar.gz 1f41a324a9f233ef5fe037cd16c4aeabaf5895ba42e2f3758f8bb7a2cddda967fc01df50d86218f316d9406bb6ced4e91d4aec8119fc8f9c2f11b4ecf24e551f 00-cpuid.patch"