summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1537737b1350489dd184ca95d6481a3c898115e5 (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
# Maintainer: Aaron Ali <t0nedef@causal.ca>
# Contributor: damir <damir@archlinux.org>

pkgname=fftw2-float
pkgver=2.1.5
pkgrel=1
pkgdesc="A C subroutine library for computing the discrete Fourier transform (DFT); Defaults to single precision"
arch=('i686' 'x86_64')
url="http://www.fftw.org/"
license=('GPL2')
depends=('openmpi')
makedepends=('gcc-fortran')
options=('!libtool')
provides=(fftw2)
source=(
	"http://www.fftw.org/fftw-${pkgver}.tar.gz"
	"doctex.patch"
)
install=${pkgname}.install

build() {
  cd "${srcdir}"

	# clean source tree and apply patch for latex info files
	# (which are not cleaned by default)
	cd fftw-${pkgver}
	./configure -q
	cd doc
	make maintainer-clean # doing this on the entire tree results in inability to build
	cd ..
	./configure -q
	make distclean
	cd ..
	patch -p0 < doctex.patch

	# copy source tree for two build options
	cp -r fftw-${pkgver} fftw-${pkgver}-double

  # build single precision
  cd fftw-${pkgver}
  ./configure F77=gfortran --prefix=/usr \
              --enable-float \
              --enable-type-prefix \
              --enable-shared \
              --enable-threads \
              --enable-mpi \
              --infodir=/usr/share/info
  make
  cd ../

   # build double precision
  cd fftw-${pkgver}-double
  ./configure F77=gfortran --prefix=/usr \
              --enable-type-prefix \
              --enable-shared \
              --enable-threads \
              --enable-mpi \
              --infodir=/usr/share/info
  make
}

package() {
  # install single precision
  cd "${srcdir}"/fftw-${pkgver}
  make DESTDIR="${pkgdir}" install
  
  # install double precision
  cd "${srcdir}"/fftw-${pkgver}-double
  make DESTDIR="${pkgdir}" install
  
  # provide single precision as default
  
  for f in "${pkgdir}"/usr/{include,$(get_libdir)}/*sfft*; do
    ln -s $(basename ${f}) ${f/sfft/fft}
  done
  for f in "${pkgdir}"/usr/{include,$(get_libdir)}/*srfft*; do
    ln -s $(basename ${f}) ${f/srfft/rfft}
  done
}
#
md5sums=('8d16a84f3ca02a785ef9eb36249ba433'
         'ab9e67b83c3254f32aa12b9b16b7d80f')