APKBUILD 2.07 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
_pkgname=OpenBLAS
pkgver=0.2.18
6
pkgrel=0
Isaac Dunham's avatar
Isaac Dunham committed
7 8 9 10 11 12
pkgdesc="A fast BSD-licensed BLAS based on gotoBLAS2, with LAPACK"
url="http://www.openblas.net"
arch="all"
license="BSD"
depends=""
depends_dev="gfortran"
13
makedepends="$depends_dev perl linux-headers"
Isaac Dunham's avatar
Isaac Dunham committed
14
subpackages="$pkgname-dev $pkgname-doc"
15
source="$pkgname-$pkgver.tar.gz::http://github.com/xianyi/$_pkgname/archive/v$pkgver.tar.gz
16 17
	0001-Use-strsignal-instead-of-sys_siglist.patch
	"
18
builddir="$srcdir/$_pkgname-$pkgver"
Isaac Dunham's avatar
Isaac Dunham committed
19

20 21
# DYNAMIC_ARCH: supported on x86* only, see https://github.com/xianyi/OpenBLAS/issues/709
case "$CARCH" in
22 23
x86 | x86_64) _dynamic_arch=1 ;;
*) _dynamic_arch=0 ;;
24 25 26 27
esac

# USE_OPENMP=0: see GCC bug 60035
# NO_AFFINITY: don't expect to work on musl, also breaks R
28
# NUM_THREADS=32: match CONFIG_NR_CPUS
29 30 31 32 33 34 35
_flags="USE_OPENMP=0
	NO_LAPACK=0
	NUM_THREADS=32
	MAJOR_VERSION=3
	NO_AFFINITY=1
	DYNAMIC_ARCH=$_dynamic_arch
	"
36

Isaac Dunham's avatar
Isaac Dunham committed
37
build() {
38 39 40
	cd "$builddir"

	CFLAGS= make CFLAGS="$CFLAGS" $_flags PREFIX=/usr TOPDIR="$builddir"
Isaac Dunham's avatar
Isaac Dunham committed
41 42 43
}

package() {
44 45
	cd "$builddir"

Isaac Dunham's avatar
Isaac Dunham committed
46
	mkdir -pm 0755 "$pkgdir/usr/lib" "$pkgdir/usr/include" \
47
		"$pkgdir/usr/share/doc/$pkgname" || return 1
48 49 50 51 52

	make $_flags PREFIX="$pkgdir/usr" install || return 1

	local file; for file in *.txt *.md LICENSE; do
		install -m 0644 $file "$pkgdir/usr/share/doc/$pkgname" || return 1
Isaac Dunham's avatar
Isaac Dunham committed
53 54
	done
}
55 56

md5sums="805e7f660877d588ea7e3792cda2ee65  openblas-0.2.18.tar.gz
57
ddce6ae8c2af85ebdd14e9150960d1c6  0001-Use-strsignal-instead-of-sys_siglist.patch"
58
sha256sums="7d9f8d4ea4a65ab68088f3bb557f03a7ac9cb5036ef2ba30546c3a28774a4112  openblas-0.2.18.tar.gz
59
4e662d5dd5d03e0067c856d3c359d4306a8fb1ad66c2a70a7cf851decf5fdea3  0001-Use-strsignal-instead-of-sys_siglist.patch"
60
sha512sums="224990959ead6247613519f52447c31968170349a0040e746862b948c851166499050f5db7cefc66f9c1695262457980ae8d0e49b14f3442267f2a43f5a14e47  openblas-0.2.18.tar.gz
61
d3dd7cad2c0bc5414642cf51a46bc57e681c4449bd829bf304c743c44c53f29d90ba0c43233bf5a7cce3e6b057d1c1cef27d0ccffecb50125993b34c913477c8  0001-Use-strsignal-instead-of-sys_siglist.patch"