summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ee4488ec3504403ed12a40ca379e77e4feab8861 (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
# Maintainer: Eric Berquist <eric DOT berquist AT gmail DOT com>

_basename=fftw
pkgname=fftw2
pkgver=2.1.5
pkgrel=1
pkgdesc="A library for computing the discrete Fourier transform (DFT), major version 2, with OpenMPI"
arch=("i686" "x86_64")
license=("GPL2")
url="http://www.fftw.org/"
provides=("${pkgname}")
conflicts=("${pkgname}")
depends=("glibc")
makedepends=("gcc-fortran" "openmpi")
options=("libtool" "staticlibs")
source=("http://www.fftw.org/${_basename}-${pkgver}.tar.gz")
sha1sums=('12020b58edc1b0490a83db4aa912fac5dfdfb26b')
install=fftw2.install

# notes:
# http://www.fftw.org/fftw2_doc/fftw_6.html#SEC69
# http://www.fftw.org/faq/section2.html#singleprec
# http://www.fftw.org/fftw3_doc/Precision.html#Precision

build() {
  cd ${srcdir}

  # Don"t want to switch all the variable names in the PKGBUILD.
  mv ${_basename}-${pkgver} ${pkgname}-${pkgver}
  
  cp -a ${pkgname}-${pkgver} ${pkgname}-${pkgver}-double
  mv ${pkgname}-${pkgver} ${pkgname}-${pkgver}-single

  # use upstream default CFLAGS while keeping our -march/-mtune
  CFLAGS+=" -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math"

  CONFIGURE="./configure \
                 F77=gfortran \
                 --with-gcc \
                 --prefix=/usr \
                 --infodir=/usr/share/info \
                 --enable-type-prefix \
                 --enable-shared \
                 --enable-threads \
                 --enable-openmp \
                 --enable-mpi"

  # double precision
  cd ${srcdir}/${pkgname}-${pkgver}-double
  ${CONFIGURE}
  make

  # single precision
  cd ${srcdir}/${pkgname}-${pkgver}-single
  ${CONFIGURE} --enable-float
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}-double
  make check

  cd ${srcdir}/${pkgname}-${pkgver}-single
  make check  
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}-double
  make DESTDIR=${pkgdir} install

  cd ${srcdir}/${pkgname}-${pkgver}-single
  make DESTDIR=${pkgdir} install  
}