summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 997ba0e7949b87187bd6de1b0d94c9328b86fde4 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Contributor: Anton Bazhenov <anton.bazhenov at gmail>
# Contributor: Tom K <tomk@runbox.com>
# Contributor: Aaron Ali <t0nedef@causal.ca>
# AUR4 Maintainer: McNoggins <gagnon88 AT gmail DOT com>

pkgname=mpb
pkgver=v1.6.1
pkgrel=1
pkgdesc="A program for computing the band structures and electromagnetic modes"
arch=('i686' 'x86_64')
url="https://mpb.readthedocs.io"
license=('GPL')
depends=('lapack' 'hdf5' 'openmpi' 'fftw-mpi' 'libctl')
makedepends=('gcc-fortran')
source=(git+https://github.com/stevengj/$pkgname.git)
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname"
  git describe --long --tags | cut -d-  -f1
}

build() {
	cd "$srcdir/$pkgname"
	git checkout $pkgver
	cd ../
	cp -r $pkgname $pkgname-inv
	cp -r $pkgname $pkgname-mpi
	cp -r $pkgname $pkgname-inv-mpi

	# configure includes two options for working with GNU Fortran and HDF5 v1.8.x
	cd $pkgname
	sh autogen.sh
	./configure \
		F77="gfortran" \
		CPPFLAGS="-DH5_USE_16_API=1" \
		--prefix=/usr \
		--enable-shared \
		--mandir=/usr/share/man
	make

	# configure inversion symmetry binaries (run at least 2x as fast)
	cd ../$pkgname-inv
	sh autogen.sh
	./configure \
		F77="gfortran" \
		CPPFLAGS="-DH5_USE_16_API=1" \
		--prefix=/usr \
		--enable-shared \
		--with-inv-symmetry \
		--mandir=/usr/share/man
	make

	# configure parrallel computation
	cd ../$pkgname-mpi
	sh autogen.sh
	./configure \
		F77="gfortran" \
		CPPFLAGS="-DH5_USE_16_API=1" \
		--prefix=/usr \
		--enable-shared \
		--with-mpi \
		--mandir=/usr/share/man
	make

	# configure parrallel computation
	cd ../$pkgname-inv-mpi
	sh autogen.sh
	./configure \
		F77="gfortran" \
		CPPFLAGS="-DH5_USE_16_API=1" \
		--prefix=/usr \
		--enable-shared \
		--with-inv-symmetry \
		--with-mpi \
		--mandir=/usr/share/man
	make
}

package() { 
	cd "$srcdir"/$pkgname
	make prefix="$pkgdir"/usr mandir="$pkgdir"/usr/share/man install 

	cd "$srcdir"/$pkgname-inv
	make prefix="$pkgdir"/usr mandir="$pkgdir"/usr/share/man install 

	cd "$srcdir"/$pkgname-mpi
	make prefix="$pkgdir"/usr mandir="$pkgdir"/usr/share/man install 

	cd "$srcdir"/$pkgname-inv-mpi
	make prefix="$pkgdir"/usr mandir="$pkgdir"/usr/share/man install 
}