Commit 25ed1ef7 authored by Jakub Jirutka's avatar Jakub Jirutka
Browse files

testing/openblas: add ILP64 variant (subpackage -ilp64)

parent a931ebbb
# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Isaac Dunham <ibid.ag@gmail.com>
pkgname=openblas
_pkgname=OpenBLAS
pkgver=0.2.18
pkgrel=1
pkgrel=2
pkgdesc="A fast BSD-licensed BLAS based on gotoBLAS2, with LAPACK"
url="http://www.openblas.net"
arch="all"
......@@ -11,36 +12,58 @@ license="BSD"
depends=""
depends_dev="gfortran"
makedepends="$depends_dev perl linux-headers"
subpackages="$pkgname-dev $pkgname-doc"
subpackages="$pkgname-dev $pkgname-doc $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
"
builddir="$srcdir/$_pkgname-$pkgver"
# 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
_builddir64="$builddir-64"
# USE_OPENMP=0: see GCC bug 60035
# NO_AFFINITY: don't expect to work on musl, also breaks R
# NUM_THREADS=32: match CONFIG_NR_CPUS
# NO_AFFINITY: don't expect to work on musl, also breaks R and not
# recommended for Julia
_flags="USE_OPENMP=0
NO_LAPACK=0
NUM_THREADS=32
MAJOR_VERSION=3
NO_AFFINITY=1
DYNAMIC_ARCH=$_dynamic_arch
"
# 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" ;;
esac
# Flags for ILP64 variant.
_flags64="$_flags
INTERFACE64=1
SYMBOLSUFFIX=64_"
prepare() {
default_prepare || return 1
cp -ar "$builddir" "$_builddir64"
}
build() {
cd "$builddir"
CFLAGS= make -C "$builddir" \
$_flags CFLAGS="$CFLAGS" PREFIX=/usr || return 1
CFLAGS= make CFLAGS="$CFLAGS" $_flags PREFIX=/usr TOPDIR="$builddir"
if [ "$CARCH" = "x86_64" ]; then
msg "Building with ILP64..."
CFLAGS= make -C "$_builddir64" \
$_flags64 CFLAGS="$CFLAGS" PREFIX=/usr || return 1
fi
}
package() {
if [ "$CARCH" = "x86_64" ]; then
make -C "$_builddir64" $_flags64 \
PREFIX="$pkgdir/usr" install || return 1
fi
cd "$builddir"
make $_flags PREFIX="$pkgdir/usr" install || return 1
......@@ -56,6 +79,14 @@ package() {
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
ilp64() {
pkgdesc="$pkgdesc (ILP64)"
arch="x86_64"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libopenblas64_* "$subpkgdir"/usr/lib/
}
md5sums="805e7f660877d588ea7e3792cda2ee65 openblas-0.2.18.tar.gz
ddce6ae8c2af85ebdd14e9150960d1c6 0001-Use-strsignal-instead-of-sys_siglist.patch"
sha256sums="7d9f8d4ea4a65ab68088f3bb557f03a7ac9cb5036ef2ba30546c3a28774a4112 openblas-0.2.18.tar.gz
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment