summaryrefslogtreecommitdiff
path: root/extra/lapack/PKGBUILD
blob: b76ee52a4eda1f3739a2a2bb5a3a5718d747fcd1 (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
62
63
64
65
66
67
68
# $Id: PKGBUILD 198759 2013-11-03 11:28:03Z ronald $
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Jason Taylor <jftaylor21@gmail.com>

pkgbase=lapack
pkgname=('lapack' 'blas')
pkgver=3.4.2
pkgrel=2
url="http://www.netlib.org/lapack"
pkgdesc="Linear Algebra PACKage"
makedepends=('gcc-fortran' 'cmake')
depends=('gcc-libs')
arch=('i686' 'x86_64' 'mips64el')
license=("custom")
source=(http://www.netlib.org/${pkgbase}/${pkgbase}-${pkgver}.tgz
        LICENSE.blas)
sha1sums=('93a6e4e6639aaf00571d53a580ddc415416e868b'
          '2491a151a37f0162b25fc4e4e9a8ac444b574a76')

build() {
  cd "${srcdir}"

  install -d build
  cd build
  cmake ../${pkgname}-${pkgver} \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_SKIP_RPATH=ON \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_Fortran_COMPILER=gfortran \
    -DLAPACKE=ON
  make
}

package_lapack() {
  depends=("blas=${pkgver}")

  install -m755 -d ${pkgdir}/usr/{lib,bin,include}
  
  for libname in liblapack libtmglib liblapacke; do
    install -m755 "${srcdir}/build/lib/${libname}.so" \
      "${pkgdir}/usr/lib/"
    ln -sf ${libname}.so "${pkgdir}/usr/lib/${libname}.so.${pkgver}"
    ln -sf ${libname}.so "${pkgdir}/usr/lib/${libname}.so.3"
  done
  
  install -m755 ${srcdir}/build/bin/* ${pkgdir}/usr/bin
  install -m644 ${srcdir}/build/include/* ${pkgdir}/usr/include
  install -m755 -d "${pkgdir}/usr/share/licenses/lapack"
  install -m644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" \
    "${pkgdir}/usr/share/licenses/lapack/"
}

package_blas() {
  pkgdesc="Basic Linear Algebra Subprograms"

  install -m755 -d "${pkgdir}/usr/lib"
  install -m755 "${srcdir}/build/lib/libblas.so" \
      "${pkgdir}/usr/lib/"
  ln -sf libblas.so "${pkgdir}/usr/lib/libblas.so.${pkgver}"
  ln -sf libblas.so "${pkgdir}/usr/lib/libblas.so.3"

  install -m755 -d "${pkgdir}/usr/share/licenses/blas"
  install -m644 "${srcdir}/LICENSE.blas" \
    "${pkgdir}/usr/share/licenses/blas/"
}