Guest User

Untitled

a guest
Jan 28th, 2020
421
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Viktor Drobot (aka dviktor) <linux776 [at] gmail [dot] com>
  2. # Maintainer: Anton Kudelin <kudelin [at] protonmail [dot] com>
  3.  
  4. pkgname=cp2k
  5. pkgver=7.1.0
  6. _dbcsrver=2.0.1
  7. pkgrel=1
  8. pkgdesc="A quantum chemistry and solid state physics software package"
  9. arch=("x86_64")
  10. url="https://www.cp2k.org"
  11. license=("GPL2")
  12. depends=('fftw' 'elpa' 'libxc' 'libint2' 'libxsmm' 'spglib')
  13. makedepends=('gcc-fortran' 'python' 'sed')
  14. checkdepends=('numactl')
  15. optdepends=('cuda: GPU calculations support'
  16. 'plumed-mpi: enhanced sampling support')
  17. provides=("$pkgname")
  18. conflicts=("$pkgname-bin" "$pkgname-git" "$pkgname-data")
  19. source=("https://github.com/cp2k/cp2k/archive/v$pkgver.tar.gz"
  20. "https://github.com/cp2k/dbcsr/archive/v$_dbcsrver.tar.gz"
  21. "basic.psmp"
  22. "cuda_plumed.psmp"
  23. "cuda.psmp"
  24. "plumed.psmp")
  25. sha256sums=('e244f76d7e1e98da7e4e4b2e6cefb723fa1205cfae4f94739413be74952e8b4e'
  26. '1e283a3b9ce90bda321d77f4fa611b09a7eaad167d7bc579b2e9311f7b97b5ec'
  27. 'SKIP'
  28. 'SKIP'
  29. 'SKIP'
  30. 'SKIP')
  31.  
  32. prepare() {
  33. cd $srcdir/$pkgname-$pkgver
  34.  
  35. # Prepare DBCSR
  36. cp -r $srcdir/dbcsr-$_dbcsrver/* exts/dbcsr
  37.  
  38. # Set up the default build environment
  39. export _buildmode=0
  40. export _arch="basic"
  41. export _corenumber=$( grep -c ^processor /proc/cpuinfo )
  42. export _elpaver=$( ls /usr/include | grep elpa | sed 's/elpa_openmp-//g' )
  43.  
  44. # Enable additional features
  45. if [ -d "/opt/cuda" ]
  46. then
  47. msg2 "Adding CUDA support"
  48. _buildmode=$((_buildmode | 1))
  49. fi
  50.  
  51. if [ -d "/usr/lib/plumed" ]
  52. then
  53. msg2 "Adding PLUMED support"
  54. _buildmode=$((_buildmode | 2))
  55. fi
  56.  
  57. case $_buildmode in
  58. 0)
  59. _arch="basic"
  60. ;;
  61. 1)
  62. _arch="cuda"
  63. ;;
  64. 2)
  65. _arch="plumed"
  66. ;;
  67. 3)
  68. _arch="cuda_plumed"
  69. ;;
  70. esac
  71.  
  72. # Move arch-file into a proper directory
  73. mv ../$_arch.psmp arch
  74.  
  75. # Changing the location of the data directory
  76. sed -i 's@$(CP2KHOME)/data@/usr/share/cp2k/data@g' Makefile
  77. }
  78.  
  79. build() {
  80. cd $srcdir/$pkgname-$pkgver
  81. make ARCH=$_arch VERSION=psmp
  82. }
  83.  
  84. check() {
  85. export DATA_DIR=$srcdir/$pkgname-$pkgver/data
  86. cd $srcdir/$pkgname-$pkgver/tools/regtesting
  87.  
  88. # In the case of a test failure you must examine it carefully
  89. # because it can lead to an unpredictable error during a production run.
  90. ./do_regtest -cp2kdir ../.. -version psmp -arch $_arch -nobuild -maxtasks $_corenumber
  91. }
  92.  
  93. package() {
  94. cd $srcdir/$pkgname-$pkgver/exe/$_arch
  95. install -dm755 $pkgdir/usr/{bin,share/$pkgname}
  96. install -Dm755 cp2k.psmp $pkgdir/usr/bin/cp2k
  97. install -Dm755 cp2k_shell.psmp $pkgdir/usr/bin/cp2k-shell
  98. install -Dm755 graph.psmp $pkgdir/usr/bin/cp2k-graph
  99. cp -r ../../data $pkgdir/usr/share/$pkgname
  100. chmod -R 755 $pkgdir/usr/share/$pkgname
  101. }
RAW Paste Data