APKBUILD 2.2 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 5
pkgver=0.2.17
pkgrel=0
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 16 17
source="$pkgname-$pkgver.tar.gz::http://github.com/xianyi/OpenBLAS/archive/v$pkgver.tar.gz
	0001-Use-strsignal-instead-of-sys_siglist.patch
	"
Isaac Dunham's avatar
Isaac Dunham committed
18 19 20 21 22 23 24 25 26 27 28 29

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

30 31 32 33 34 35 36 37
# 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
38 39
# NUM_THREADS=32: match CONFIG_NR_CPUS
FLAGS="USE_OPENMP=0 NO_LAPACK=0 NUM_THREADS=32 MAJOR_VERSION=3 \
40 41
	NO_AFFINITY=1 DYNAMIC_ARCH=$DYNAMIC_ARCH"

Isaac Dunham's avatar
Isaac Dunham committed
42 43
build() {
	cd "$_builddir"
44 45
# 
	CFLAGS= make CFLAGS="$CFLAGS" $FLAGS PREFIX=/usr TOPDIR="$_builddir" || return 1
Isaac Dunham's avatar
Isaac Dunham committed
46 47 48 49 50
}

package() {
	cd "$_builddir"
	mkdir -pm 0755 "$pkgdir/usr/lib" "$pkgdir/usr/include" \
51 52
		"$pkgdir/usr/share/doc/$pkgname" || return 1
	make $FLAGS  PREFIX="$pkgdir/usr" install || return 1
Isaac Dunham's avatar
Isaac Dunham committed
53 54 55 56
	for FILE in *.txt *.md LICENSE; do
		install -m 0644 $FILE "$pkgdir/usr/share/doc/$pkgname" || return 1
	done
}
57 58 59 60 61 62
md5sums="664a12807f2a2a7cda4781e3ab2ae0e1  openblas-0.2.17.tar.gz
ddce6ae8c2af85ebdd14e9150960d1c6  0001-Use-strsignal-instead-of-sys_siglist.patch"
sha256sums="0fe836dfee219ff4cadcc3567fb2223d9e0da5f60c7382711fb9e2c35ecf0dbf  openblas-0.2.17.tar.gz
4e662d5dd5d03e0067c856d3c359d4306a8fb1ad66c2a70a7cf851decf5fdea3  0001-Use-strsignal-instead-of-sys_siglist.patch"
sha512sums="ae49294e0d4903d5f385c256956ac950a75cbc4f828a31c7c324e2512831afa955c22d71e965256c355d38e45cde1987ee2babb12ba9ab9e99323e476790b507  openblas-0.2.17.tar.gz
d3dd7cad2c0bc5414642cf51a46bc57e681c4449bd829bf304c743c44c53f29d90ba0c43233bf5a7cce3e6b057d1c1cef27d0ccffecb50125993b34c913477c8  0001-Use-strsignal-instead-of-sys_siglist.patch"