updated on Wed Jan 11 00:07:16 UTC 2012
[aur-mirror.git] / scalapack / PKGBUILD
blob995843aa1702cb7365aa707a785330aeb8cbb8a3
1 # Maintainer: Michele Mocciola <mickele>
2 pkgname=scalapack
3 pkgver=1.8.0
4 pkgrel=2
5 pkgdesc="ScaLAPACK (or Scalable LAPACK) library includes a subset of LAPACK routines redesigned for distributed memory MIMD parallel computers."
6 url="http://www.netlib.org/scalapack/"
7 license='custom'
8 depends=('glibc' 'mpich2' 'blacs-mpi' 'atlas-lapack')
9 makedepends=('gcc' 'coreutils' 'sed' 'binutils')
10 provides=()
11 conflicts=()
12 replaces=()
13 backup=()
14 arch=('i686' 'x86_64')
15 install=${pkgname}.install
16 source=(http://www.netlib.org/scalapack/$pkgname.tgz http://www.netlib.org/scalapack/manpages.tgz LICENSE Makefile example1.f)
18 build() {
19   export PATH=$PATH:/opt/mpich2/bin
21   cd ${srcdir}/${pkgname}-${pkgver} || return 1
22   sed -e "s|\$(HOME)/SCALAPACK|$PWD|" \
23       -e "s|BLACSdir      = /usr/local/lib|BLACSdir      = /usr/lib |" \
24       -e "s|SMPLIB        = /usr/local/mpich-1.2.1/lib/libmpich.a|SMPLIB        = -Wl,-rpath,/opt/mpich2/lib -L/opt/mpich2/lib -lmpich -lssl -luuid -lpthread -lrt -ldl -lnsl -lrt|" \
25       -e "s|BLACSFINIT    = \$(BLACSdir)/libmpiblacsF77init-p4.a|BLACSFINIT    = -L/usr/lib -lblacsf77|" \
26       -e "s|BLACSCINIT    = \$(BLACSdir)/libmpiblacsCinit-p4.a|BLACSCINIT    = -L/usr/lib -lblacsc|" \
27       -e "s|BLACSLIB      = \$(BLACSdir)/libmpiblacs-p4.a|BLACSLIB      = -L/usr/lib -lblacs|" \
28       -e "s|F77FLAGS      =  -O3 \$(NOOPT)|F77FLAGS =  -Wno-unused-variable $CFLAGS \$(NOOPT) -fpic|" \
29       -e "s|CCFLAGS       = -O4|CCFLAGS = $CFLAGS  -Wwrite-strings -Wno-strict-aliasing -fpic|" \
30       -e "s|F77LOADFLAGS  =|F77LOADFLAGS  = \$(F77FLAGS)|" \
31       -e "s|CCLOADFLAGS   =|CCLOADFLAGS   = \$(CCFLAGS)|" \
32       -e "s|CDEFS         = -Df77IsF2C -DNO_IEEE \$(USEMPI)|CDEFS         = -DAdd_ -DNO_IEEE \$(USEMPI)|" \
33       -e "s|BLASLIB       = /usr/local/lib/libf77blas.a /usr/local/lib/libatlas.a|BLASLIB       = -lblas -latlas|" \
34       -e "s|LAPACKLIB     = /usr/local/lib/liblapack.a|LAPACKLIB     = -llapack -lcblas|" \
35       < SLmake.inc.example > SLmake.inc
37   # Builds library, test and example
38   make lib || return 1
39   ld -Bshareable -o  ${srcdir}/${pkgname}-${pkgver}/lib${pkgname}.so -x -soname lib${pkgname}.so --whole-archive $startdir/src/${pkgname}-${pkgver}/lib${pkgname}.a || return 1
40   make exe || return 1
41   make example || return 1
44 package(){
45   cd ${srcdir}/${pkgname}-${pkgver} || return 1
47   # Install headers
48   install -m 755 -d ${pkgdir}/usr/include || return 1
49   install -m 644 -D ${srcdir}/$pkgname-$pkgver/PBLAS/SRC/*.h ${pkgdir}/usr/include || return 1
51   # Install libraries
52   install -m 644 -D ${srcdir}/$pkgname-$pkgver/lib$pkgname.a ${pkgdir}/usr/lib/lib$pkgname.a || return 1
53   install -m 755 ${srcdir}/$pkgname-$pkgver/lib$pkgname.so ${pkgdir}/usr/lib || return 1
55   # Install man pages
56   install -m 755 -d ${pkgdir}/usr/share/man/manl || return 1
57   install -m 644 ${srcdir}/MANPAGES/man/manl/*.l ${PREFIX} ${pkgdir}/usr/share/man/manl || return 1
59   # Install test
60   install -m 755 -d ${pkgdir}/usr/share/$pkgname/testing || return 1
61   install -m 755 ${srcdir}/$pkgname-$pkgver/TESTING/x* ${pkgdir}/usr/share/$pkgname/testing || return 1
62   install -m 644 ${srcdir}/$pkgname-$pkgver/TESTING/*.dat ${pkgdir}/usr/share/$pkgname/testing || return 1
64   # Install examples
65   install -m 755 -d ${pkgdir}/usr/share/$pkgname/examples || return 1
66   install -m 644 ${srcdir}/Makefile ${pkgdir}/usr/share/$pkgname/examples || return 1
67   install -m 644 ${srcdir}/example1.f ${pkgdir}/usr/share/$pkgname/examples || return 1
69   # Install license
70   install -m 644 -D ${srcdir}/LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1
72 md5sums=('f4a3f3d7ef32029bd79ab8abcc026624'
73          'a536ab4837ec68addff0a3ec99427a10'
74          '182bf79471c020e8274fec5ef1240005'
75          '0bef36150ffaf341a6228b474ed800c9'
76          '4723ad431356431bb193db254b6ee0fb')