summaryrefslogtreecommitdiff
path: root/extra/lapack/PKGBUILD
blob: cdefb472038af5783d0ef0fbecd520ae2f5e2d36 (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
# $Id: PKGBUILD 171531 2012-11-18 12:48:44Z 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=1
url="http://www.netlib.org/lapack"
pkgdesc="Linear Algebra PACKage"
makedepends=('gcc-fortran' 'cmake')
depends=('gcc-libs')
arch=('i686' 'x86_64')
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
  make
}

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

  install -m755 -d ${pkgdir}/usr/{lib,bin}
  
  for libname in liblapack libtmglib; do
    install -m755 "${srcdir}/build/lib/${libname}.so" \
      "${pkgdir}/usr/lib/"
    ln -sf liblapack.so "${pkgdir}/usr/lib/${libname}.so.${pkgver}"
    ln -sf liblapack.so "${pkgdir}/usr/lib/${libname}.so.3"
  done
  
  install -m755 ${srcdir}/build/bin/* ${pkgdir}/usr/bin
  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/"
}