summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 66d1da0cefbcbcdbb714c4bde666ea7856ae41f4 (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
52
53
54
55
56
57
58
59
60
61
# Maintainer: thrasibule <guillaume.horel@gmail.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
_PkgName=OpenBLAS
_pkgname=openblas
pkgver=0.3.27
# grep VERSION "${srcdir}/${_PkgName}-${pkgver}"/lapack-netlib/README.md | tail -n 1 | cut -d ' ' -f 2
_lapackver=3.11.0
_blasver=3.11.0
pkgrel=1
pkgdesc="Optimized BLAS library based on GotoBLAS2 1.13 BSD (providing blas, lapack, and cblas)"
arch=('x86_64')
url="http://www.openblas.net/"
license=('BSD')
depends=('gcc-libs')
makedepends=('perl' 'gcc-fortran')
provides=('openblas' "blas=${_blasver}" "lapack=${_lapackver}" "cblas=${_blasver}" "lapacke=${_lapackver}")
conflicts=('openblas' 'blas' 'lapack' 'cblas' 'lapacke')
options=(!emptydirs)
source=(${_PkgName}-${pkgver}.tar.gz::https://github.com/xianyi/OpenBLAS/releases/download/v${pkgver}/OpenBLAS-$pkgver.tar.gz)
sha256sums=('aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897')

# Add the following line to the _config variable if you want to set the number of make jobs
#  MAKE_NB_JOBS=2 \
_config="FC=gfortran USE_OPENMP=1 USE_THREAD=1 \
  USE_TLS=1 \
  MAJOR_VERSION=0 NO_STATIC=1"

build(){
  cd "${_PkgName}-${pkgver}"
  unset MAKEFLAGS
  make ${_config} shared
}

check() {
  cd "${_PkgName}-${pkgver}"
  unset MAKEFLAGS
  make ${_config} tests
}

package(){
  cd "${_PkgName}-${pkgver}"

  make ${_config} PREFIX=/usr DESTDIR="${pkgdir}" install

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

  # Symlink to provide blas, cblas, lapack and lapacke
  cd "${pkgdir}/usr/lib/"
  for _lib in blas cblas lapack lapacke; do
    ln -s libopenblas.so lib${_lib}.so
    ln -s libopenblas.so lib${_lib}.so.${_blasver:0:1}
    ln -s libopenblas.so lib${_lib}.so.${_blasver}
    ln -s openblas.pc "${pkgdir}/usr/lib/pkgconfig/${_lib}.pc"
  done
}
# vim:set ts=2 sw=2 et: