PKGBUILDs/extra/fftw/PKGBUILD
2017-10-31 23:21:03 +00:00

67 lines
1.8 KiB
Bash

# $Id$
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: damir <damir@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - removed -malign-double from CFLAGS
# - removed --enable-sse2 from double precision
# - removed --enable-sse from single precision
pkgname=fftw
pkgver=3.3.7
pkgrel=1
pkgdesc="A library for computing the discrete Fourier transform (DFT)"
arch=('i686' 'x86_64')
license=('GPL2')
url="http://www.fftw.org/"
depends=('bash' 'gcc-libs')
makedepends=('gcc-fortran')
source=("http://www.fftw.org/${pkgname}-${pkgver}.tar.gz")
sha1sums=('2ae980a8d44c161ce4a09c6e2d1c79243ecbabb2')
# 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}
cp -a ${pkgname}-${pkgver} ${pkgname}-${pkgver}-double
cp -a ${pkgname}-${pkgver} ${pkgname}-${pkgver}-long-double
mv ${pkgname}-${pkgver} ${pkgname}-${pkgver}-single
# use upstream default CFLAGS while keeping our -march/-mtune
CFLAGS+=" -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math"
CONFIGURE="./configure F77=gfortran --prefix=/usr \
--enable-shared --enable-threads"
# build double precision
cd ${srcdir}/${pkgname}-${pkgver}-double
$CONFIGURE
make
# build & install long double precission
cd ${srcdir}/${pkgname}-${pkgver}-long-double
$CONFIGURE --enable-long-double
make
# build & install single precision
cd ${srcdir}/${pkgname}-${pkgver}-single
$CONFIGURE --enable-float
make
}
package() {
cd ${srcdir}/${pkgname}-${pkgver}-double
make DESTDIR=${pkgdir} install
cd ${srcdir}/${pkgname}-${pkgver}-long-double
make DESTDIR=${pkgdir} install
cd ${srcdir}/${pkgname}-${pkgver}-single
make DESTDIR=${pkgdir} install
}