summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8241e4de0074a4b19ece2a3a4ea08cec365208ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer:  Anton Kudelin <kudelin at protonmail dot com>
# Contributor: Scott Tincman <sctincman at gmail dot com>

pkgname=octopus
pkgver=11.3
pkgrel=1
pkgdesc="Real-space Time-Dependent Density Functional Theory code"
arch=('x86_64')
url="https://octopus-code.org"
license=('LGPL')
depends=('elpa' 'gd' 'gsl' 'libxc' 'libvdwxc' 'netcdf-fortran' 'parmetis'
         'nlopt' 'cgal' 'clfft' 'clblas')
makedepends=('gcc-fortran')
checkdepends=('procps-ng')
source=("$url/down.php?file=$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('0c98417071b5e38ba6cbdd409adf917837c387a010e321c0a7f94d9bd9478930')

prepare() {
  mkdir -p "$srcdir/build"
  autoreconf -if "$srcdir/$pkgname-$pkgver"
  export _elpaver=$( ls /usr/include | grep elpa | sed 's/elpa_openmp-//g' )
  export OPTFLAGS="-O3 -march=native"
}

build() {
  cd "$srcdir/build"
  ../$pkgname-$pkgver/configure \
    --prefix=/usr \
    --enable-mpi \
    --enable-vectors \
    --with-scalapack="-lscalapack" \
    --with-blacs="-lscalapack" \
    --with-elpa-prefix=/usr \
    --with-cgal=/usr \
    --with-clfft-prefix=/usr \
    --with-clblas-prefix=/usr \
    FCFLAGS_ELPA="-I/usr/include/elpa_openmp-$_elpaver/modules" \
    LIBS_ELPA="-lelpa_openmp" \
    CFLAGS="$OPTFLAGS" \
    CXXFLAGS="$OPTFLAGS" \
    FCFLAGS="$OPTFLAGS -fallow-argument-mismatch -fallow-invalid-boz"
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver/testsuite"
  sed -i "s/Yes/No/g" \
    finite_systems_1d/02-neon_mpi.test \
    functionals/18-mgga.test \
    real_time/01-propagators.test \
    real_time/06-caetrs.test

  cd "../../build"
  make check-short
}

package() {
  cd "$srcdir/build"
  make DESTDIR="$pkgdir" install
}