updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / superlu_mt / PKGBUILD
blobb6f29f8669cafdfca83705dd1e2b9defc26e1f6f
1 # Contributor: Giuseppe Borzi <gborzi@ieee.org>
2 pkgname=superlu_mt
3 pkgver=2.0
4 pkgrel=1
5 pkgdesc="Parallel subroutines to solve a sparse linear system on shared memory computer"
6 arch=('i686' 'x86_64')
7 url="http://crd.lbl.gov/~xiaoye/SuperLU/"
8 license=('custom')
9 depends=('gcc-libs' 'blas')
10 makedepends=('tcsh')
11 options=(!makeflags)
12 install=${pkgname}.install
13 source=(http://crd.lbl.gov/~xiaoye/SuperLU/${pkgname}_$pkgver.tar.gz http://crd.lbl.gov/~xiaoye/SuperLU/License.txt arch.patch)
14 md5sums=('a1cf0dba3308a2e4a0a7290714f1799d'
15          'f78e2ac527dbb50f53766475a9c542bd'
16          '4c8cec36828957803a8c2bd262a84724')
18 build() {
19   cd "$srcdir/SuperLU_MT_$pkgver"
20   patch -Np1 -i $srcdir/arch.patch
22   mkdir -p shared static
23   msg "Building shared library..."
24   cd shared
25   make -f ../SRC/Makefile VPATH=../SRC srcdir=../SRC \
26           CFLAGS="$CFLAGS -fPIC -D_PTHREAD" NOOPTS="-fPIC"\
27           ARCH="echo" ARCHFLAGS="" RANLIB="echo" \
28           SUPERLULIB=$srcdir/SuperLU_MT_$pkgver/lib/lib$pkgname.a
29   gcc -shared -Wl,-soname,lib$pkgname.so.2 -o ../lib/lib$pkgname.so.2.0 *.o \
30       -lblas -lpthread -lm
31   cd ../static
32   msg "Building static library..."
33   make -f ../SRC/Makefile VPATH=../SRC srcdir=../SRC \
34           CFLAGS="$CFLAGS -D_PTHREAD" SUPERLULIB=lib$pkgname.a
35   msg "Testing library..."
36   cd ../TESTING/MATGEN
37   make CFLAGS="-O2"
38   cd ..
39   LS_COLORS="" make CFLAGS="-O2"
40   if [ "x`grep failed *.out`" != "x" ]; then
41     msg 'Testing failed'
42     return 1
43   fi
46 package() {
47   mkdir -p $pkgdir/usr/lib $pkgdir/usr/include/$pkgname \
48            $pkgdir/usr/share/doc/$pkgname $pkgdir/usr/share/licenses/$pkgname
49   install -p -m644 $srcdir/SuperLU_MT_$pkgver/lib/lib$pkgname.a $pkgdir/usr/lib
50   install -p -m755 $srcdir/SuperLU_MT_$pkgver/lib/lib$pkgname.so.2.0 $pkgdir/usr/lib
51   cd $pkgdir/usr/lib
52   ln -s lib$pkgname.so.2.0 lib$pkgname.so.2
53   ln -s lib$pkgname.so.2 lib$pkgname.so
54   install -m644 $srcdir/SuperLU_MT_$pkgver/SRC/*.h $pkgdir/usr/include/$pkgname
55   install -m644 $srcdir/SuperLU_MT_$pkgver/DOC/ug.pdf $pkgdir/usr/share/doc/$pkgname/
56   install -m644 $srcdir/SuperLU_MT_$pkgver/README $pkgdir/usr/share/doc/$pkgname
57   install -m644 $srcdir/License.txt $pkgdir/usr/share/licenses/$pkgname
60 # vim:set ts=2 sw=2 et: