summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8a70e585d6d5cf5df7d5356305d6047172d2a2e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Maintainer: Steven Vancoillie <steven<dot>vancoillie[at]gmail[dot]com>
# Contributor: eolianoe <eolianoe [at] gmail [DoT] com>
# Contributor: Jiaxi Hu <sftrytry _AT_ gmail _DOT_ com>
# Contributor: Giuseppe Borzi <gborzi _AT_ ieee _DOT_ org>

pkgname=openblas-lapack-ilp64
_pkgname=OpenBLAS
pkgver=0.2.20
pkgrel=1
pkgdesc="Optimized BLAS library based on GotoBLAS2 (dynamic arch)"
arch=('x86_64')
url="http://xianyi.github.com/OpenBLAS/"
license=('BSD')
depends=('gcc-libs')
makedepends=('perl' 'gcc-fortran')
options=(staticlibs)
source=(${_pkgname}-v${pkgver}.tar.gz::https://github.com/xianyi/OpenBLAS/archive/v${pkgver}.tar.gz)
sha256sums=('5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394')

_config="USE_OPENMP=1 NO_LAPACK=0 INTERFACE64=1 BINARY=64 DYNAMIC_ARCH=1"

build() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  NPROC=`grep "physical id" /proc/cpuinfo|sort|uniq|wc -l`
  NCORE4PROC=`grep "cores" /proc/cpuinfo|sort|tail -n 1|sed -e 's/cpu cores.*: //'`
  let NCORE=NPROC*NCORE4PROC

  make ${_config} NUM_THREADS=$NCORE libs netlib shared

}

check() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  make ${_config} tests
}

package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  make PREFIX="${pkgdir}/opt/${pkgname}" install

  # Install license
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  # Remove reference to ${pkgdir}
  sed -i -e "s%${pkgdir}%%" "${pkgdir}/opt/${pkgname}/lib/cmake/openblas/OpenBLASConfig.cmake"
}

# vim:set ts=2 sw=2 et: