summaryrefslogtreecommitdiffstats
path: root/abs/core/lapack/PKGBUILD
blob: 145e85f30e3042c2ac791670dd87e64299c28dfc (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# $Id: PKGBUILD 94550 2010-10-08 09:23:08Z 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=('blas' 'lapack')
pkgver=3.2.2
pkgrel=2
url="http://www.netlib.org/lapack"
makedepends=('gcc-fortran')
arch=('i686' 'x86_64')
license=("custom")
source=(http://www.netlib.org/${pkgbase}/${pkgbase}-${pkgver}.tgz
        lapack-3.1.1-make.inc.patch
        Makefile.blas
        Makefile.lapack
        LICENSE.blas)
md5sums=('10832891c9e8100f81108c1ec7da0da4'
         'cdfcb9d9b162c18d9acbf63c5579ea26'
         '51a84dd3b1f04289b6b7c7f56d59c368'
         'e7936c82c853870f0144f45e9656a7ea'
         '38b6acb8ed5691d25863319d30a8b365')

build() {
  cd "${srcdir}/${pkgbase}-${pkgver}"
  patch -Np1 -i "${srcdir}/lapack-3.1.1-make.inc.patch"
  cp -f INSTALL/make.inc.gfortran make.inc
  cp -f "${srcdir}/Makefile.blas" BLAS/SRC/Makefile
  cp -f "${srcdir}/Makefile.lapack" SRC/Makefile

  export FC=gfortran

  pushd BLAS/SRC
  make clean
  FFLAGS="${CFLAGS/-O?/-O0}" make dcabs1.o
  FFLAGS="${CFLAGS} -fPIC" CFLAGS="${CFLAGS} -fPIC" make shared
  cp libblas.so.${pkgver} "${srcdir}/${pkgbase}-${pkgver}/"
  popd
  ln -s libblas.so.${pkgver} libblas.so

  pushd INSTALL
  make clean
  make NOOPT="${CFLAGS/-O?/-O0} -fPIC" OPTS="${CFLAGS} -fPIC"
  popd
  # make sure no files with '_', *vxx.o *vfx.o and *2.O as defined in *ASRC
  #  are in OBJS
  pushd SRC
  make clean
  
  make FFLAGS="${CFLAGS} -fPIC" CFLAGS="${CFLAGS} -fPIC" shared
  cp liblapack.so.${pkgver} "${srcdir}/${pkgbase}-${pkgver}/"
  popd
}

package_blas() {
  pkgdesc="Basic Linear Algebra Subprograms"
  depends=('gcc-libs>=4.5.0')
  options=('force')
  install -m755 -d "${pkgdir}/usr/lib"
  install -m755 "${srcdir}/${pkgbase}-${pkgver}/libblas.so.${pkgver}" \
    "${pkgdir}/usr/lib/" || return 1
  ln -sf libblas.so.${pkgver} "${pkgdir}/usr/lib/libblas.so"
  ln -sf libblas.so.${pkgver} "${pkgdir}/usr/lib/libblas.so.3"
  
  install -m755 -d "${pkgdir}/usr/share/licenses/blas"
  install -m644 "${srcdir}/LICENSE.blas" \
    "${pkgdir}/usr/share/licenses/blas/LICENSE" || return 1
}

package_lapack() {
  pkgdesc="Linear Algebra PACKage"
  depends=("blas=${pkgver}")
  install -m755 -d "${pkgdir}/usr/lib"
  install -m755 "${srcdir}/${pkgbase}-${pkgver}/liblapack.so.${pkgver}" \
    "${pkgdir}/usr/lib/" || return 1
  ln -sf liblapack.so.${pkgver} "${pkgdir}/usr/lib/liblapack.so"
  ln -sf liblapack.so.${pkgver} "${pkgdir}/usr/lib/liblapack.so.3"

  install -m755 -d "${pkgdir}/usr/share/licenses/lapack"
  install -m644 "${srcdir}/${pkgbase}-${pkgver}/LICENSE" \
    "${pkgdir}/usr/share/licenses/lapack/" || return 1
}