Advertisement
Guest User

Untitled

a guest
Jul 31st, 2021
1,461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.50 KB | None | 0 0
  1. # Contributor: Myles English <myles at rockhead dot biz>
  2. # Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
  3.  
  4. pkgname=scalapack
  5. pkgver=2.1.0
  6. pkgrel=3
  7. arch=('i686' 'x86_64' 'aarch64')
  8. pkgdesc="subset of scalable LAPACK routines redesigned for distributed memory MIMD parallel computers."
  9. url="http://www.netlib.org/scalapack/"
  10. license=('custom')
  11. depends=('glibc' 'openmpi' 'blas' 'lapack') # 'atlas-lapack' 'blacs-openmpi' )
  12. makedepends=('cmake' 'gcc-fortran')
  13. provides=('blacs')
  14. install=${pkgname}.install
  15. source=($pkgname-$pkgver.tar.gz::https://github.com/Reference-ScaLAPACK/scalapack/archive/refs/tags/v$pkgver.tar.gz
  16.         Makefile
  17.         example1.f)
  18. sha256sums=('f03fda720a152030b582a237f8387014da878b84cbd43c568390e9f05d24617f'
  19.             '5f7e81c1c76fc010677fd446bfc689c7f6af1a22a51093e8790e8a615159c541'
  20.             'd9904ecb69f318c4782c0bd39ff2bff511af31960a2383a9d42d6620a266ea70')
  21.  
  22. prepare() {
  23.   cd ${pkgname}-${pkgver}
  24.   sed -i 's/MPI_Type_struct/MPI_Type_create_struct/g' BLACS/SRC/*.c
  25.   sed -i 's/MPI_Attr_get/MPI_Comm_get_attr/g' BLACS/SRC/blacs_get_.c
  26. }
  27.  
  28. build() {
  29.     msg "Starting make..."
  30.  
  31.     [[ -e build ]] && rm -rf build
  32.     mkdir build
  33.     cd build
  34.  
  35.     cmake ../${pkgname}-${pkgver} \
  36.     -DCMAKE_INSTALL_PREFIX="${pkgdir}"/usr \
  37.     -DBUILD_SHARED_LIBS=ON \
  38.     -DCMAKE_BUILD_TYPE:STRING=Release \
  39.     -DCMAKE_CXX_COMPILER=/usr/bin/mpic++ \
  40.     -DCMAKE_Fortran_FLAGS="$FCFLAGS -fallow-argument-mismatch" \
  41.     -DCMAKE_C_COMPILER=/usr/bin/mpicc
  42.     make
  43. }
  44.  
  45. package(){
  46.   cd "${srcdir}"/build
  47.   make install #DESTDIR="${pkgdir}"
  48.  
  49.   sed -i 's#'${pkgdir}'##g' "${pkgdir}"/usr/lib/pkgconfig/scalapack.pc
  50.  
  51.   # Install headers
  52.   install -m 755 -d "${pkgdir}"/usr/include
  53.   install -m 644 -D "${srcdir}"/${pkgname}-${pkgver}/PBLAS/SRC/*.h "${pkgdir}"/usr/include
  54.   install -m 644 -D "${srcdir}"/${pkgname}-${pkgver}/BLACS/SRC/*.h "${pkgdir}"/usr/include
  55.  
  56.   # Install test
  57.   install -m 755 -d "${pkgdir}"/usr/share/$pkgname/testing
  58.   install -m 755 "${srcdir}"/build/TESTING/x* "${pkgdir}"/usr/share/$pkgname/testing
  59.   install -m 644 "${srcdir}"/build/TESTING/*.dat "${pkgdir}"/usr/share/$pkgname/testing
  60.  
  61.   # Install examples
  62.   install -m 755 -d "${pkgdir}"/usr/share/$pkgname/examples
  63.   install -m 644 "${srcdir}"/Makefile "${pkgdir}"/usr/share/${pkgname}/examples
  64.   install -m 644 "${srcdir}"/example1.f "${pkgdir}"/usr/share/${pkgname}/examples
  65.  
  66.   # Install license
  67.   install -m 644 -D "${srcdir}"/${pkgname}-${pkgver}/LICENSE \
  68.       "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
  69. }
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement