Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Maintainer: Viktor Drobot (aka dviktor) <linux776 [at] gmail [dot] com>
- # Maintainer: Anton Kudelin <kudelin [at] protonmail [dot] com>
- pkgname=cp2k
- pkgver=7.1.0
- _dbcsrver=2.0.1
- pkgrel=1
- pkgdesc="A quantum chemistry and solid state physics software package"
- arch=("x86_64")
- url="https://www.cp2k.org"
- license=("GPL2")
- depends=('fftw' 'elpa' 'libxc' 'libint2' 'libxsmm' 'spglib')
- makedepends=('gcc-fortran' 'python' 'sed')
- checkdepends=('numactl')
- optdepends=('cuda: GPU calculations support'
- 'plumed-mpi: enhanced sampling support')
- provides=("$pkgname")
- conflicts=("$pkgname-bin" "$pkgname-git" "$pkgname-data")
- source=("https://github.com/cp2k/cp2k/archive/v$pkgver.tar.gz"
- "https://github.com/cp2k/dbcsr/archive/v$_dbcsrver.tar.gz"
- "basic.psmp"
- "cuda_plumed.psmp"
- "cuda.psmp"
- "plumed.psmp")
- sha256sums=('e244f76d7e1e98da7e4e4b2e6cefb723fa1205cfae4f94739413be74952e8b4e'
- '1e283a3b9ce90bda321d77f4fa611b09a7eaad167d7bc579b2e9311f7b97b5ec'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP')
- prepare() {
- cd $srcdir/$pkgname-$pkgver
- # Prepare DBCSR
- cp -r $srcdir/dbcsr-$_dbcsrver/* exts/dbcsr
- # Set up the default build environment
- export _buildmode=0
- export _arch="basic"
- export _corenumber=$( grep -c ^processor /proc/cpuinfo )
- export _elpaver=$( ls /usr/include | grep elpa | sed 's/elpa_openmp-//g' )
- # Enable additional features
- if [ -d "/opt/cuda" ]
- then
- msg2 "Adding CUDA support"
- _buildmode=$((_buildmode | 1))
- fi
- if [ -d "/usr/lib/plumed" ]
- then
- msg2 "Adding PLUMED support"
- _buildmode=$((_buildmode | 2))
- fi
- case $_buildmode in
- 0)
- _arch="basic"
- ;;
- 1)
- _arch="cuda"
- ;;
- 2)
- _arch="plumed"
- ;;
- 3)
- _arch="cuda_plumed"
- ;;
- esac
- # Move arch-file into a proper directory
- mv ../$_arch.psmp arch
- # Changing the location of the data directory
- sed -i 's@$(CP2KHOME)/data@/usr/share/cp2k/data@g' Makefile
- }
- build() {
- cd $srcdir/$pkgname-$pkgver
- make ARCH=$_arch VERSION=psmp
- }
- check() {
- export DATA_DIR=$srcdir/$pkgname-$pkgver/data
- cd $srcdir/$pkgname-$pkgver/tools/regtesting
- # In the case of a test failure you must examine it carefully
- # because it can lead to an unpredictable error during a production run.
- ./do_regtest -cp2kdir ../.. -version psmp -arch $_arch -nobuild -maxtasks $_corenumber
- }
- package() {
- cd $srcdir/$pkgname-$pkgver/exe/$_arch
- install -dm755 $pkgdir/usr/{bin,share/$pkgname}
- install -Dm755 cp2k.psmp $pkgdir/usr/bin/cp2k
- install -Dm755 cp2k_shell.psmp $pkgdir/usr/bin/cp2k-shell
- install -Dm755 graph.psmp $pkgdir/usr/bin/cp2k-graph
- cp -r ../../data $pkgdir/usr/share/$pkgname
- chmod -R 755 $pkgdir/usr/share/$pkgname
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement