aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-17 15:24:02 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-08-17 15:24:41 +0200
commit3f208ae10fdf0774d88af1681909ea31d52e4efd (patch)
treecbbce451ced828d2aaa7f22e9ee9e9f64f49c244 /testing
parentfab3c7cb82e766237d06e7fed830d5d6d7dbdf2b (diff)
downloadaports-3f208ae10fdf0774d88af1681909ea31d52e4efd.tar.bz2
aports-3f208ae10fdf0774d88af1681909ea31d52e4efd.tar.xz
testing/openblas: build -ilp64 for aarch64
Diffstat (limited to 'testing')
-rw-r--r--testing/openblas/APKBUILD28
1 files changed, 18 insertions, 10 deletions
diff --git a/testing/openblas/APKBUILD b/testing/openblas/APKBUILD
index c880dac682..c5f7826abe 100644
--- a/testing/openblas/APKBUILD
+++ b/testing/openblas/APKBUILD
@@ -13,7 +13,6 @@ depends=""
depends_dev="gfortran"
makedepends="$depends_dev perl linux-headers"
subpackages="$pkgname-dev $pkgname-doc"
-[ "$CARCH" = x86_64 ] && subpackages="$subpackages $pkgname-ilp64"
source="$pkgname-$pkgver.tar.gz::http://github.com/xianyi/$_pkgname/archive/v$pkgver.tar.gz
0001-Use-strsignal-instead-of-sys_siglist.patch
"
@@ -28,13 +27,22 @@ _flags="USE_OPENMP=0
MAJOR_VERSION=3
NO_AFFINITY=1
"
-# DYNAMIC_ARCH: supported on x86* only, see https://github.com/xianyi/OpenBLAS/issues/709
-# NUM_THREADS: 64bit match kernel's CONFIG_NR_CPUS (32)
-# 32bit machines usually don't have so many cores so use 8
case "$CARCH" in
- x86_64) _flags="$_flags DYNAMIC_ARCH=1 NUM_THREADS=32" ;;
- x86) _flags="$_flags DYNAMIC_ARCH=1 NUM_THREADS=8" ;;
- *) _flags="$_flags DYNAMIC_ARCH=0 NUM_THREADS=8" ;;
+x86_64 | aarch64)
+ subpackages="$subpackages $pkgname-ilp64"
+ _flags="$_flags NUM_THREADS=32" # match kernel's CONFIG_NR_CPUS
+ _ilp64=true
+;;
+*)
+ _flags="$_flags NUM_THREADS=8" # 32bit machines usually have less cores
+ _ilp64=false
+;;
+esac
+
+# DYNAMIC_ARCH is supported on x86* only, see https://github.com/xianyi/OpenBLAS/issues/709
+case "$CARCH" in
+x86*) _flags="$_flags DYNAMIC_ARCH=1";;
+*) _flags="$_flags DYNAMIC_ARCH=0";;
esac
# Flags for ILP64 variant.
@@ -52,7 +60,7 @@ build() {
CFLAGS= make -C "$builddir" \
$_flags CFLAGS="$CFLAGS" PREFIX=/usr || return 1
- if [ "$CARCH" = "x86_64" ]; then
+ if $_ilp64; then
msg "Building with ILP64..."
CFLAGS= make -C "$_builddir64" \
$_flags64 CFLAGS="$CFLAGS" PREFIX=/usr || return 1
@@ -60,7 +68,7 @@ build() {
}
package() {
- if [ "$CARCH" = "x86_64" ]; then
+ if $_ilp64; then
make -C "$_builddir64" $_flags64 \
PREFIX="$pkgdir/usr" install || return 1
fi
@@ -82,7 +90,7 @@ package() {
ilp64() {
pkgdesc="$pkgdesc (ILP64)"
- arch="x86_64"
+ arch="x86_64 aarch64"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libopenblas64_* "$subpkgdir"/usr/lib/