summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 309068f19166cf8ffa1964f994628134112a2bf1 (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
# Maintainer: Anton Kudelin <kudelin at proton dot me>

pkgname=siesta
pkgver=5.0.0
pkgrel=1
pkgdesc="A first-principles materials simulation code using DFT"
arch=(x86_64 aarch64)
url="https://siesta-project.org/siesta/About/overview.html"
license=(GPL-3.0-only)
depends=(elpa metis fftw python libxc)
makedepends=(gcc-fortran ninja)
source=(https://gitlab.com/siesta-project/siesta/-/archive/$pkgver/$pkgname-$pkgver.tar.bz2)
sha256sums=('1ae1b6a50e6bad8503799bd55ce41de6851c243aacea48c3816d99ef996e9b0a')

prepare() {
  # Handling ELPA
  _elpaver=$( ls /usr/include | grep elpa | sed 's/elpa_openmp-//g' )
}

build() {
  cd "$srcdir"
  cmake \
    -B build \
    -S $pkgname-$pkgver \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_EXE_LINKER_FLAGS="-lelpa_openmp -lscalapack -lmpi" \
    -D SIESTA_WITH_ELPA=ON \
    -D SIESTA_WITH_OPENMP=ON \
    -D ELPA_INCLUDE_DIRS="/usr/include/elpa_openmp-$_elpaver/elpa;/usr/include/elpa_openmp-$_elpaver/modules" \
    -D ELPA_LINK_LIBRARIES="-lelpa_openmp" \
    -G Ninja \
    -W no-dev
  cmake --build build
}

check() {
  cd "$srcdir/build"
  ctest
}

package() {
  cd "$srcdir"
  DESTDIR="$pkgdir" cmake --install build
}