Username: Password: Remember me
# Contributor: Giuseppe Borzi <gborzi@ieee.org>
 
pkgname=superlu
pkgver=5.2.1
pkgrel=1
pkgdesc="Set of subroutines to solve a sparse linear system"
arch=('x86_64')
url="http://crd.lbl.gov/~xiaoye/SuperLU/"
license=('custom')
depends=('gcc-libs' 'openblas')
makedepends=('gcc-fortran' 'tcsh')
install=$pkgname.install
source=(http://crd.lbl.gov/~xiaoye/SuperLU/${pkgname}_$pkgver.tar.gz 
        http://crd.lbl.gov/~xiaoye/SuperLU/License.txt
        http://crd.lbl.gov/~xiaoye/SuperLU/superlu_ug.pdf)
md5sums=('3a1a9bff20cb06b7d97c46d337504447'
         'f78e2ac527dbb50f53766475a9c542bd'
         '0097d559fa73f8fc182ac05635537454')
 
build() {
  cd SuperLU_$pkgver
 
  mkdir shared static
  msg "Building shared library..."
  cd shared
  make -f ../SRC/Makefile VPATH=../SRC srcdir=../SRC CC=cc \
          CFLAGS="$CFLAGS -fPIC" FORTRAN=gfortran FFLAGS="$CFLAGS -fPIC" \
          PLAT="" BLASDEF="" BLASLIB="-lblas" CDEFS="-DAdd_" NOOPTS="-fPIC" \
          ARCH="echo" ARCHFLAGS="" RANLIB="echo" \
          SUPERLULIB=$srcdir/SuperLU_$pkgver/lib/lib$pkgname.a
  gcc -shared -Wl,-soname,lib$pkgname.so.4 -o ../lib/lib$pkgname.so.$pkgver \
      *.o -lblas -lm -lgfortran
  cd ../static
  msg "Building static library..."
  make -f ../SRC/Makefile VPATH=../SRC srcdir=../SRC CC=cc \
          CFLAGS="$CFLAGS" FORTRAN=gfortran FFLAGS="$CFLAGS" \
          PLAT="" BLASDEF="" BLASLIB="-lblas" CDEFS="-DAdd_" \
          ARCH="echo" ARCHFLAGS="" RANLIB="echo" \
          SUPERLULIB=$srcdir/SuperLU_$pkgver/lib/lib$pkgname.a
  ar cr ../lib/lib$pkgname.a *.o
}
 
# check() {
#   cd "$srcdir/SuperLU_$pkgver"
# 
#   msg "Testing library..."
#   cd TESTING
#   LS_COLORS="" make -j1 SUPERLULIB=../lib/libsuperlu.a BLASLIB=-lblas \
#           CC=cc CFLAGS="-O2" LOADER="cc" LOADOPTS=""
#   if [ "x`grep failed *.out`" != "x" ]; then
#     msg 'Testing failed'
#     return 1
#   fi
# }
 
package() {
  cd SuperLU_$pkgver
  mkdir -p $pkgdir/usr/lib $pkgdir/usr/include/$pkgname \
           $pkgdir/usr/share/doc/$pkgname \
           $pkgdir/usr/share/licenses/$pkgname
  install -p -m644 $srcdir/SuperLU_$pkgver/lib/lib$pkgname.a $pkgdir/usr/lib
  install -p -m755 $srcdir/SuperLU_$pkgver/lib/lib$pkgname.so.$pkgver $pkgdir/usr/lib
  cd $pkgdir/usr/lib
  ln -s lib$pkgname.so.$pkgver lib$pkgname.so.4
  ln -s lib$pkgname.so.4 lib$pkgname.so
  install -m644 $srcdir/SuperLU_$pkgver/SRC/*.h $pkgdir/usr/include/$pkgname
  install -m644 $srcdir/superlu_ug.pdf $pkgdir/usr/share/doc/$pkgname/superlu_ug.pdf
  install -m644 $srcdir/SuperLU_$pkgver/README $pkgdir/usr/share/doc/$pkgname
  install -m644 $srcdir/License.txt $pkgdir/usr/share/licenses/$pkgname
}
 
# vim:set ts=2 sw=2 et: