APKBUILD 1.74 KB
Newer Older
Isaac Dunham's avatar
Isaac Dunham committed
1 2 3
# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Maintainer: Isaac Dunham <ibid.ag@gmail.com>
pkgname=openblas
4
pkgver=0.2.15
5
pkgrel=1
Isaac Dunham's avatar
Isaac Dunham committed
6 7 8 9 10 11
pkgdesc="A fast BSD-licensed BLAS based on gotoBLAS2, with LAPACK"
url="http://www.openblas.net"
arch="all"
license="BSD"
depends=""
depends_dev="gfortran"
12
makedepends="$depends_dev perl linux-headers"
Isaac Dunham's avatar
Isaac Dunham committed
13 14
install=""
subpackages="$pkgname-dev $pkgname-doc"
15
source="$pkgname-$pkgver.tar.gz::http://github.com/xianyi/OpenBLAS/archive/v$pkgver.tar.gz"
Isaac Dunham's avatar
Isaac Dunham committed
16 17 18 19 20 21 22 23 24 25 26 27

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

28 29 30 31 32 33 34 35
# DYNAMIC_ARCH: supported on x86* only, see https://github.com/xianyi/OpenBLAS/issues/709
case "$CARCH" in
x86 | x86_64) DYNAMIC_ARCH=1 ;;
*) DYNAMIC_ARCH=0 ;;
esac

# USE_OPENMP=0: see GCC bug 60035
# NO_AFFINITY: don't expect to work on musl, also breaks R
36 37
# NUM_THREADS=32: match CONFIG_NR_CPUS
FLAGS="USE_OPENMP=0 NO_LAPACK=0 NUM_THREADS=32 MAJOR_VERSION=3 \
38 39
	NO_AFFINITY=1 DYNAMIC_ARCH=$DYNAMIC_ARCH"

Isaac Dunham's avatar
Isaac Dunham committed
40 41
build() {
	cd "$_builddir"
42
	make $FLAGS PREFIX=/usr || return 1
Isaac Dunham's avatar
Isaac Dunham committed
43 44 45 46 47
}

package() {
	cd "$_builddir"
	mkdir -pm 0755 "$pkgdir/usr/lib" "$pkgdir/usr/include" \
48 49
		"$pkgdir/usr/share/doc/$pkgname" || return 1
	make $FLAGS  PREFIX="$pkgdir/usr" install || return 1
Isaac Dunham's avatar
Isaac Dunham committed
50 51 52 53
	for FILE in *.txt *.md LICENSE; do
		install -m 0644 $FILE "$pkgdir/usr/share/doc/$pkgname" || return 1
	done
}
54 55 56
md5sums="b1190f3d3471685f17cfd1ec1d252ac9  openblas-0.2.15.tar.gz"
sha256sums="73c40ace5978282224e5e122a41c8388c5a19e65a6f2329c2b7c0b61bacc9044  openblas-0.2.15.tar.gz"
sha512sums="5b61556a9bd2c622bc31ec7a1b4cbab67740e40c4f0717670b16987d687efdd83d3bd8b2c0b158a8da956ef04665cf9a00b6b1f1619b6353a206a31a5e5d6c9a  openblas-0.2.15.tar.gz"