X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 6CEA0DC05BE for ; Thu, 28 Aug 2014 22:19:13 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id hz1so4332702pad.20 for ; Thu, 28 Aug 2014 15:19:11 -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=flqYoym7LPu/+4kLXba6Uf5+ZZyARjgCzLBwWF5sr98=; b=hNtndkGeZqSWOGePeI8N208ESZaWO99+F4Jqvv5WP9QZIi5jqQSdlQjnsIGF7oXhzd BbKOMtdI56g7dcdwJtzRtIul2QFxqie20Nn5Kpet7jw5fqsTRmwbZGB1W4V+BbP43SJi jAreQCEV2nYrMVgzSxeHSVuwAjfH5ZlBIDnS84KXVC3Yv6KYaPqnXTPfMz6TlgmvfMbe zDkzu41spZSIBfQff8p5CyFaF9SXrQ9wDwMJn7cIVDXaxSIqq2ngA3ZVc1lGhM60bkcs BarjQ1AcMcSPtNtsq/6MZYAsZa+3PX/jGrfRCLWjUIUUfx7DqSk0Lm4cwGAFpK/ZRcYv WEnw== X-Received: by 10.69.18.203 with SMTP id go11mr10264860pbd.50.1409264350291; Thu, 28 Aug 2014 15:19:10 -0700 (PDT) Received: from localhost.localdomain ([50.0.224.184]) by mx.google.com with ESMTPSA id ba5sm4566878pbd.72.2014.08.28.15.19.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 15:19:09 -0700 (PDT) From: Isaac Dunham To: alpine-devel@lists.alpinelinux.org Cc: Isaac Dunham Subject: [alpine-devel] [PATCH 1/2] Add testing/openblas. Date: Thu, 28 Aug 2014 15:19:03 -0700 Message-Id: <1409264344-5879-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: OpenBLAS is a fast implementation of BLAS that's easier to build than ATLAS; it also includes LAPACK support. --- testing/openblas/00-cpuid.patch | 34 ++++++++++++++++++++++++++ testing/openblas/APKBUILD | 53 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 testing/openblas/00-cpuid.patch create mode 100644 testing/openblas/APKBUILD diff --git a/testing/openblas/00-cpuid.patch b/testing/openblas/00-cpuid.patch new file mode 100644 index 0000000..7758b46 --- /dev/null +++ b/testing/openblas/00-cpuid.patch @@ -0,0 +1,34 @@ +commit db7e6366cd86b57cd0712293968938058288bde0 +Author: Isaac Dunham +Date: Thu Aug 28 13:05:07 2014 -0700 + + Workaround PIC limitations in cpuid. + + cpuid uses register ebx, but ebx is reserved in PIC. + So save ebx, swap ebx & edi, and return edi. + + Copied from Igor Pavlov's equivalent fix for 7zip (in CpuArch.c), + which is public domain and thus OK license-wise. + +diff --git a/cpuid_x86.c b/cpuid_x86.c +index 53016e1..f9df722 100644 +--- a/cpuid_x86.c ++++ b/cpuid_x86.c +@@ -59,9 +59,16 @@ + void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx); + #else + static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){ ++#if defined(__i386__) && defined(__PIC__) ++ __asm__ __volatile__ ++ ("mov %%ebx, %%edi;" ++ "cpuid;" ++ "xchgl %%ebx, %%edi;" ++ : "=a" (*eax), "=D" (*ebx), "=c" (*ecx), "=d" (*edx) : "a" (op) : "cc"); ++#else + __asm__ __volatile__ + ("cpuid": "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "a" (op) : "cc"); +- ++#endif + } + #endif + diff --git a/testing/openblas/APKBUILD b/testing/openblas/APKBUILD new file mode 100644 index 0000000..ce6f2fc --- /dev/null +++ b/testing/openblas/APKBUILD @@ -0,0 +1,53 @@ +# Contributor: Isaac Dunham +# Maintainer: Isaac Dunham +pkgname=openblas +pkgver=0.2.11 +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.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 +#DYNAMIC_ARCH=1 requires 00-cpuid.patch + make USE_OPENMP=0 NO_LAPACK=0 NUM_THREADS=8 MAJOR_VERSION=3 \ + NO_AFFINITY=1 DYNAMIC_ARCH=1 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 DYNAMIC_ARCH=1 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="c456f3c5e84c3ab69ef89b22e616627a openblas-0.2.11.tar.gz +0b8b59052a6387fe4aa9e3e473b3749b 00-cpuid.patch" +sha256sums="dc06836e700ef26519933af309a25958150693c376a536fe35d633d76f1a5606 openblas-0.2.11.tar.gz +65a809e9f0f06fd9ccefd0af6bc7c398fefe011404f699926946320783050d8b 00-cpuid.patch" +sha512sums="68abdf8366d4766fe5d852ca3850ea6236d4dc5bad044fa4116ca60872716003746bcfdb1005aac87533d9a085ae319ef18b7ed6f293baf88c79fd7c8562c9f0 openblas-0.2.11.tar.gz +1f41a324a9f233ef5fe037cd16c4aeabaf5895ba42e2f3758f8bb7a2cddda967fc01df50d86218f316d9406bb6ced4e91d4aec8119fc8f9c2f11b4ecf24e551f 00-cpuid.patch" -- 2.1.0 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---