X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 2FA50DC0C14 for ; Thu, 28 Aug 2014 15:54:15 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id rd3so3092018pab.10 for ; Thu, 28 Aug 2014 08:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Iva6QnPcU37EzMuiuFlP908da+wnHMOZjGhaYJtf45k=; b=XZJrL7RE2rqwnMsV0aeczA0/zB/IA1K0bsizgDYRH/05YFZwXhgGWrsolBIzJZgq96 b5UpIHsvr3KEMSNKR/9qFHk6pLP70+AL8TyaQfsUAjbAtdTAIiUFA7GHRrIi9Otg6zs9 Sik1BqTeanOJg1ctKvmcZRV0GjoTpnJkKqyxWGAppcnhQyFzuWauR1t4+OXX8G78WP97 K92tLWX5QfFNaNG11COSsrbqTQOARPZzb51vIYwaIjxzeKADrJb56sL+KxaD4u8XlGei 8b73DQsRX6f1+5/0a0IG/jxQsuvBRI8iytat4ymumP/Osutwet4MSaThGTHE7swKGJF5 U9Rg== X-Received: by 10.68.68.234 with SMTP id z10mr7049096pbt.59.1409241251162; Thu, 28 Aug 2014 08:54:11 -0700 (PDT) Received: from localhost.localdomain ([50.0.224.184]) by mx.google.com with ESMTPSA id qy10sm2394413pbb.47.2014.08.28.08.54.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 08:54:10 -0700 (PDT) From: Isaac Dunham To: alpine-devel@lists.alpinelinux.org Cc: Isaac Dunham Subject: [alpine-devel] [PATCH 1/2] Add openblas 0.2.10: an easy-to-build BLAS implementation. Date: Thu, 28 Aug 2014 08:53:56 -0700 Message-Id: <1409241237-2314-1-git-send-email-ibid.ag@gmail.com> X-Mailer: git-send-email 2.1.0 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: I've added a couple bugfixes cherry-picked from the development branch. --- testing/openblas/00-cpuid-arm.patch | 21 ++++++++++++++ testing/openblas/01-sysconf.patch | 51 +++++++++++++++++++++++++++++++++ testing/openblas/APKBUILD | 56 +++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 testing/openblas/00-cpuid-arm.patch create mode 100644 testing/openblas/01-sysconf.patch create mode 100644 testing/openblas/APKBUILD diff --git a/testing/openblas/00-cpuid-arm.patch b/testing/openblas/00-cpuid-arm.patch new file mode 100644 index 0000000..cff164c --- /dev/null +++ b/testing/openblas/00-cpuid-arm.patch @@ -0,0 +1,21 @@ +commit 1f2f00647d8b31f75165b552d120e00aa4683cbe +Author: Isaiah Norton +Date: Thu Jul 31 04:59:30 2014 +0000 + + cpuid_arm: fix detection when cpuinfo uses "Processor" + + instead of "model name" + +diff --git a/cpuid_arm.c b/cpuid_arm.c +index 809ef3d..b7181b2 100644 +--- a/cpuid_arm.c ++++ b/cpuid_arm.c +@@ -90,7 +90,7 @@ int detect(void) + while (fgets(buffer, sizeof(buffer), infile)) + { + +- if (!strncmp("model name", buffer, 10)) ++ if ((!strncmp("model name", buffer, 10)) || (!strncmp("Processor", buffer, 9))) + { + p = strchr(buffer, ':') + 2; + break; diff --git a/testing/openblas/01-sysconf.patch b/testing/openblas/01-sysconf.patch new file mode 100644 index 0000000..5af32ee --- /dev/null +++ b/testing/openblas/01-sysconf.patch @@ -0,0 +1,51 @@ +commit 7f9226a11d6dcf27262d6cc42e51332e482b54ad +Author: Isaac Dunham +Date: Sun Aug 3 15:06:30 2014 -0700 + + Fix link error on Linux/musl. + + get_nprocs() is a GNU convenience function equivalent to POSIX2008 + sysconf(_SC_NPROCESSORS_ONLN); the latter should be available in unistd.h + on any current *nix. (OS X supports this call since 10.5, and FreeBSD + currently supports it. But this commit does not change FreeBSD or OS X + versions.) + +diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md +index 58748ea..18a218c 100644 +--- a/CONTRIBUTORS.md ++++ b/CONTRIBUTORS.md +@@ -114,5 +114,8 @@ In chronological order: + * carlkl + * [2013-12-13] Fixed LAPACKE building bug on Windows + ++* Isaac Dunham ++ * [2014-08-03] Fixed link error on Linux/musl ++ + * [Your name or handle] <[email or website]> + * [Date] [Brief summary of your changes] +diff --git a/driver/others/init.c b/driver/others/init.c +index 30d35e0..85c7ca6 100644 +--- a/driver/others/init.c ++++ b/driver/others/init.c +@@ -847,7 +847,7 @@ void gotoblas_set_affinity2(int threads) {}; + + void gotoblas_affinity_reschedule(void) {}; + +-int get_num_procs(void) { return get_nprocs(); } ++int get_num_procs(void) { return sysconf(_SC_NPROCESSORS_ONLN); } + + int get_num_nodes(void) { return 1; } + +diff --git a/driver/others/memory.c b/driver/others/memory.c +index f44b37b..9fdb18f 100644 +--- a/driver/others/memory.c ++++ b/driver/others/memory.c +@@ -162,7 +162,7 @@ int get_num_procs(void); + #else + int get_num_procs(void) { + static int nums = 0; +- if (!nums) nums = get_nprocs(); ++ if (!nums) nums = sysconf(_SC_NPROCESSORS_ONLN); + return nums; + } + #endif diff --git a/testing/openblas/APKBUILD b/testing/openblas/APKBUILD new file mode 100644 index 0000000..1bcdda1 --- /dev/null +++ b/testing/openblas/APKBUILD @@ -0,0 +1,56 @@ +# Contributor: Isaac Dunham +# Maintainer: Isaac Dunham +pkgname=openblas +pkgver=0.2.10 +pkgrel=0 +pkgdesc="A fast BSD-licensed BLAS based on gotoBLAS2, with LAPACK" +url="http://www.openblas.net" +arch="all" +license="BSD" +depends="" +depends_dev="gfortran" +makedepends="$depends_dev" +install="" +subpackages="$pkgname-dev $pkgname-doc" +source="$pkgname-$pkgver.tar.gz::http://github.com/xianyi/OpenBLAS/archive/v$pkgver.tar.gz + 00-cpuid-arm.patch + 01-sysconf.patch" + +_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 +} + +build() { + cd "$_builddir" +#USE_OPENMP=0: see GCC bug 60035 +#NO_AFFINITY: don't expect to work on musl, also breaks R + make USE_OPENMP=0 NO_LAPACK=0 NUM_THREADS=2 MAJOR_VERSION=3 \ + NO_AFFINITY=1 TARGET=ATOM PREFIX=/usr || return 1 +} + +package() { + cd "$_builddir" + mkdir -pm 0755 "$pkgdir/usr/lib" "$pkgdir/usr/include" \ + "$pkgdir/usr/share/doc/$pkgname" || return 1 + make USE_OPENMP=0 NO_LAPACK=0 NUM_THREADS=2 MAJOR_VERSION=3 \ + NO_AFFINITY=1 TARGET=ATOM PREFIX="$pkgdir/usr" install || return 1 + for FILE in *.txt *.md LICENSE; do + install -m 0644 $FILE "$pkgdir/usr/share/doc/$pkgname" || return 1 + done +} +md5sums="eb3ff035734ce5f4e1ff9d3e5c7ac734 openblas-0.2.10.tar.gz +23129cfbe53ccd872d53de86a49befeb 00-cpuid-arm.patch +c76c1e2aec82b0bbc4be7b597073626d 01-sysconf.patch" +sha256sums="210ba4ba9f20275ebe9edb7cd555f1d8374a5797a3d2a8382e12e33ca3304b24 openblas-0.2.10.tar.gz +dd4c217d02f983b8bba1735fe1efae0119470d19ef4cb50a7a19d8fc631109e9 00-cpuid-arm.patch +c421313c6f199f043620910fb7baab022df4671cf4d96fb1e7ae3f20fc0309af 01-sysconf.patch" +sha512sums="f672e4f95c3979ce695ed96e5c0ea8645057c4abb6e79092c87ff410d8cff8dbe751ee75d91f32770add96ad1ad3ae9278f254d93be2fc95e13110f00fa0ce85 openblas-0.2.10.tar.gz +3a142905daa575e0367d7c80f99a19474f73663655d5eb5fbd5289fd3c21b23e5b06df4fb894af9b446782ed5c3e28dbdccea5dfadf1523f9c8dfd90fbe3c49c 00-cpuid-arm.patch +d96d63b93925d7336bd435d072757bae4bf6e0a975a1a9d4c7b3df1cc608dc1e5dc12749945cac1fa74b69752ff498526ddb8218f7ba5ae7f23e7627c63b43da 01-sysconf.patch" -- 2.1.0 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---